Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi NG,
I have this code where I copy one column to another worksheet, in preparation for an import into a system. The columns I have, in some cases are numeric and need to be imported as text. In some cases the column may have text and numbers, but need to be text import. Can any suggest how to modify this code to give me a text column? Sub HeadCpy() Application.ScreenUpdating = False Dim wks1 As Worksheet Dim wks2 As Worksheet Set wks1 = Workbooks("IMPUT CATTLE W NW Version 1.1.xls").Worksheets("IMPUT") Set wks2 = Workbooks("IMPUT CATTLE W NW Version 1.1.xls").Worksheets("Output") With wks1 .Range(.Range("D2"), .Range("D2").End(xlDown)).Copy wks2.Range("D2") End With Set wks1 = Nothing Set wks2 = Nothing Application.ScreenUpdating = True End Sub Any assistance is appreciated. TIA Paul |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Paul,
wks2.Columns("D:D").NumberFormat = "@" Jim Cone San Francisco, USA wrote in message oups.com Hi NG, I have this code where I copy one column to another worksheet, in preparation for an import into a system. The columns I have, in some cases are numeric and need to be imported as text. In some cases the column may have text and numbers, but need to be text import. Can any suggest how to modify this code to give me a text column? Sub HeadCpy() Application.ScreenUpdating = False Dim wks1 As Worksheet Dim wks2 As Worksheet Set wks1 = Workbooks("IMPUT CATTLE W NW Version 1.1.xls").Worksheets("IMPUT") Set wks2 = Workbooks("IMPUT CATTLE W NW Version 1.1.xls").Worksheets("Output") With wks1 .Range(.Range("D2"), .Range("D2").End(xlDown)).Copy wks2.Range("D2") End With Set wks1 = Nothing Set wks2 = Nothing Application.ScreenUpdating = True End Sub Any assistance is appreciated. TIA Paul |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks very much Jim.
It works a treat. Cheers Paul Jim Cone wrote: Paul, wks2.Columns("D:D").NumberFormat = "@" Jim Cone San Francisco, USA |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Column with currency & text - how to format? | Excel Discussion (Misc queries) | |||
Setting Column format as text | Excel Programming | |||
Max value in 1 column when all values format are text | Excel Programming | |||
Column format as Text | Excel Programming | |||
column format as text | Excel Programming |