Set a column to "text"

  • Thread starter Thread starter JimS
  • Start date Start date
J

JimS

I'm using Office 2007, using the Excel object model from Access VBA. I want
to select a column (say, column G), then turn it all to text. It may contain
mostly numbers, but I want Excel (and ultimately Access) to see the entire
column as text. There is a way to do this manually, but I need to do it
through VBA. Anybody got a quick code snippet they could share? I'd
appreciate it....
 
I don't use Access, so I'm not sure about requirements, if any, for running
the Excel object model from within it; however, the VBA statement that
formats Column "G" as Text is this...

Columns("G").NumberFormat = "@"
 
I'm using Office 2007, using the Excel object model from Access VBA. I want
to select a column (say, column G), then turn it all to text. It may contain
mostly numbers, but I want Excel (and ultimately Access) to see the entire
column as text. There is a way to do this manually, but I need to do it
through VBA. Anybody got a quick code snippet they could share? I'd
appreciate it....

Have you tried this? ...

Sub Macro1()
'
' Macro1 Macro
' Macro recorded 10/08/2009 by Tom Lavedas
'

'
Columns("G:G").Select
Selection.NumberFormat = "@"
End Sub
_____________________
Tom Lavedas
 
Back
Top