Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Easy but not for me!!

Hi I recieved a reply from Bob Phillips AND Tom Ogilvy
regarding a question I had on formatting of cells on my
sheet.

I would like to use the following code to specify that
the cells D6:D26 will always have the format of number
and 2 decimal places.

If ActiveCell.Numberformat = "0.00"
or
Activecell.Numberformat = "#,###.00"

Can you tell me how to use the above code and directly
link it to my cells D6:26

I know its simple but no matter how I try and specify the
range it doesnt work.

Thank you!

Lynda.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,089
Default Easy but not for me!!

Lynda

Range("D2:D26").NumberFormat = "#,###.00"

Regards

Trevor


"Lynda" wrote in message
...
Hi I recieved a reply from Bob Phillips AND Tom Ogilvy
regarding a question I had on formatting of cells on my
sheet.

I would like to use the following code to specify that
the cells D6:D26 will always have the format of number
and 2 decimal places.

If ActiveCell.Numberformat = "0.00"
or
Activecell.Numberformat = "#,###.00"

Can you tell me how to use the above code and directly
link it to my cells D6:26

I know its simple but no matter how I try and specify the
range it doesnt work.

Thank you!

Lynda.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Easy but not for me!!

Lynda,

I think you just want something like

Range("D2:D6").NumberFormat = "#,##0/00"

But be aware, if all cells are of that format it returns True, but if not,
it doesn't return False, it returns Null. But you can easily test with

If Range("D2:D6").NumberFormat = "#,##0/00" Then
... do your stuf
End If

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Lynda" wrote in message
...
Hi I recieved a reply from Bob Phillips AND Tom Ogilvy
regarding a question I had on formatting of cells on my
sheet.

I would like to use the following code to specify that
the cells D6:D26 will always have the format of number
and 2 decimal places.

If ActiveCell.Numberformat = "0.00"
or
Activecell.Numberformat = "#,###.00"

Can you tell me how to use the above code and directly
link it to my cells D6:26

I know its simple but no matter how I try and specify the
range it doesnt work.

Thank you!

Lynda.



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Thank You


Thats Great!


-----Original Message-----
Hi I recieved a reply from Bob Phillips AND Tom Ogilvy
regarding a question I had on formatting of cells on my
sheet.

I would like to use the following code to specify that
the cells D6:D26 will always have the format of number
and 2 decimal places.

If ActiveCell.Numberformat = "0.00"
or
Activecell.Numberformat = "#,###.00"

Can you tell me how to use the above code and directly
link it to my cells D6:26

I know its simple but no matter how I try and specify

the
range it doesnt work.

Thank you!

Lynda.
.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Probably and Easy one kusky Excel Discussion (Misc queries) 4 July 26th 06 08:22 PM
Probably easy but I need help! djbob2k2 Excel Worksheet Functions 1 September 19th 05 01:44 AM
new user with easy question? not easy for me speakeztruth New Users to Excel 5 June 3rd 05 09:40 PM
easy one! MD Excel Programming 4 June 11th 04 12:01 PM
An easy one! Dr. Schwartz[_3_] Excel Programming 2 January 19th 04 12:33 PM


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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"