Hello Everyone,
I am trying to get MS to set a range in Excel to Text format. I have gone through the Excel documentation as suggested in the manual but no luck.
Specific bit of code I am using is the below but I can not figure out what the format part of this should be
XLSetRangeFormat>XY,Sheet1,B2:B10000,
Thanks for any help you can provide.
Excel Set Range Format
Moderators: Dorian (MJT support), JRL
- Dorian (MJT support)
- Automation Wizard
- Posts: 1389
- Joined: Sun Nov 03, 2002 3:19 am
- Contact:
Re: Excel Set Range Format
I wasn't too sure either, so I recorded an Excel macro to format text and looked to see what it created.
This was the result :
So :
This was the result :
Code: Select all
Sub Macro1()
'
' Macro1 Macro
'
'
Range("D3:E6").Select
Selection.NumberFormat = "@"
End Sub
Code: Select all
XLSetRangeFormat>xlh,FormatTest,B2:B10000,@
Yes, we have a Custom Scripting Service. Message me or go here
Re: Excel Set Range Format
This worked perfectly thanks very much!