ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Formatting (https://www.excelbanter.com/excel-worksheet-functions/51714-formatting.html)

vgurusa

Formatting
 

Hi Ppl,

How to format the Worksheet programatically from a software like Visual
Basic ?

For e.g. the worksheets specific rows have to be changed into
numberformat="Number" instead of default "General"

Thanks,

Vijay


--
vgurusa
------------------------------------------------------------------------
vgurusa's Profile: http://www.excelforum.com/member.php...o&userid=28100
View this thread: http://www.excelforum.com/showthread...hreadid=478321


JE McGimpsey

Formatting
 
One way:

Application.Workbooks("Book1.xls").Sheets("Sheet1" ).Range( _
"1:10").NumberFormat = "0.00"


In article ,
vgurusa wrote:

Hi Ppl,

How to format the Worksheet programatically from a software like Visual
Basic ?

For e.g. the worksheets specific rows have to be changed into
numberformat="Number" instead of default "General"

Thanks,

Vijay


vgurusa

Formatting
 

Hi JE,

Thats not working, I always get an error subscript out of range error!

Can you suggest another way !

Thanks,

Vijay


--
vgurusa
------------------------------------------------------------------------
vgurusa's Profile: http://www.excelforum.com/member.php...o&userid=28100
View this thread: http://www.excelforum.com/showthread...hreadid=478321


Nick Hodge

Formatting
 
Vijay

A #9 subscript out of range error is generated if the code can't find a
referenced element in the code, for example if you reference Sheet10 and you
don't have one

--
HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
www.nickhodge.co.uk
HIS


"vgurusa" wrote in
message ...

Hi JE,

Thats not working, I always get an error subscript out of range error!

Can you suggest another way !

Thanks,

Vijay


--
vgurusa
------------------------------------------------------------------------
vgurusa's Profile:
http://www.excelforum.com/member.php...o&userid=28100
View this thread: http://www.excelforum.com/showthread...hreadid=478321





All times are GMT +1. The time now is 09:09 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com