Blockquote
hello i am trying to copy and paste a text formatted column's values from sheet1 to sheet 2. However the value type automatically changed into number.
Dim wb As Workbook Dim src As Worksheet Dim tgt As Worksheet Dim lastRow As Variant
Set wb = ThisWorkbook
Set src = wb.Sheets("sheet1")
Set tgt = wb.Sheets("sheet2")
lastRow = src.Range("A" & src.Rows.Count).End(xlDown).Row
tgt.Range("E43:E" & lastRow).Value = src.Range("A5:A" & lastRow).Value
what i get with this code is
1
2
11
12
the data is formatted in sheet1 like this:
00000001
00000002
00000011
00000012
and i want the same thing in sheet 2
tgt.Range("E43:E" & lastRow)..NumberFormat = "0000000"
– Damiancopy
see my answer below... – alowflyingpig