S
SSDSCA
I have some code that I use to make a new worksheet and I need to copy and
paste the values from one column to another in the new worksheet. The cells
that I copy from have formulas and are dependent on other cells that may or
may not have values in them. The problem that I am having is that the cells
that have no values on the old worksheet return a #value when pasted on the
new sheet. My preference would be to have a blank cell. The code that I am
using at present is below and I am running Office 2003.
Sub NewInventory()
ActiveSheet.Copy After:=ActiveSheet
Range("A1") = Range("A1") + 1
Range("G5:G507").Select
Selection.Copy
Range("E5").Select
Selection.PasteSpecial Paste:=xlPasteValues, _
Operation:=xlNone, _
SkipBlanks:=True, _
Transpose:=False
Range("H5:H507,J5:J507,S5:S507").Select
Selection.ClearContents
Range("A1").Select
End Sub
paste the values from one column to another in the new worksheet. The cells
that I copy from have formulas and are dependent on other cells that may or
may not have values in them. The problem that I am having is that the cells
that have no values on the old worksheet return a #value when pasted on the
new sheet. My preference would be to have a blank cell. The code that I am
using at present is below and I am running Office 2003.
Sub NewInventory()
ActiveSheet.Copy After:=ActiveSheet
Range("A1") = Range("A1") + 1
Range("G5:G507").Select
Selection.Copy
Range("E5").Select
Selection.PasteSpecial Paste:=xlPasteValues, _
Operation:=xlNone, _
SkipBlanks:=True, _
Transpose:=False
Range("H5:H507,J5:J507,S5:S507").Select
Selection.ClearContents
Range("A1").Select
End Sub