Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Set a column to "text"
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.... -- Jim |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Set a column to "text"
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 = "@" -- Rick (MVP - Excel) "JimS" wrote in message ... 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.... -- Jim |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Set a column to "text"
On Oct 8, 3:50*pm, JimS wrote:
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.... -- Jim 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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Text "comparison" operator for "contains" used in an "IF" Function | Excel Worksheet Functions | |||
How do I change the column heading in Excel to display "A" "B" "C | New Users to Excel | |||
Please add a "sheet" function like "row" and "column" functions | Excel Programming | |||
Insert "-" in text "1234567890" to have a output like this"123-456-7890" | Excel Discussion (Misc queries) | |||
How do I split "A1B2" into "A1" and "B2" using text to column fun. | Excel Programming |