EdLB
asked on
VBA changes part numbers when copying
I have a list of part numbers and two of them give me trouble when copying using vba.
The part numbers:
6000-18-1
6000-18-2
get converted to
8/1/6000
8/2/6000
when using the code below to copy parts from ws1 to ws2
Worksheets("ws1").Activate
Range(Cells(2, 1), Cells(LastRow, 1)).Copy
Worksheets("ws2").Activate
Range(Cells(2, 1), Cells(LastRow, 1)).PasteSpecial paste:=xlPasteValues, Operation:=xlNone, SkipBlanks:=False, Transpose:=False
I tried to format column 1 in ws2 as text (Range("A1").EntireColumn. NumberForm at = "@") before doing the paste but that gives me an error.
Help please..
The part numbers:
6000-18-1
6000-18-2
get converted to
8/1/6000
8/2/6000
when using the code below to copy parts from ws1 to ws2
Worksheets("ws1").Activate
Range(Cells(2, 1), Cells(LastRow, 1)).Copy
Worksheets("ws2").Activate
Range(Cells(2, 1), Cells(LastRow, 1)).PasteSpecial paste:=xlPasteValues, Operation:=xlNone, SkipBlanks:=False, Transpose:=False
I tried to format column 1 in ws2 as text (Range("A1").EntireColumn.
Help please..
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Worksheets.("ws1"). Range(Cells(2, 1), Cells(EndRow, 1)).Copy
Worksheets("ws2").Activate
Range("A2").Select
ActiveSheet.paste