A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » Worksheet Functions
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Custom Formatting



 
 
Thread Tools Display Modes
  #1  
Old December 8th, 2008, 11:16 PM posted to microsoft.public.excel.worksheet.functions
Aaron
external usenet poster
 
Posts: 45
Default Custom Formatting

Hi,

I have a cell that I want to have a number and a letter in, ie 0.02 g.
I need to be able to set this format based on another cells current
formatting which might be 0.000 or 0.000 0 or 0.000 00 etc. (Every 3
decimal places there goes a space before more decimal place holders
are listed.)

I currently use a macro tied to a button called Decimal Place to
change the rest of the sheet based on a keycell's decimal placing, but
I dont know how to have it do it to a cell and then add a "g" after
it.

Sub DP()

Application.ScreenUpdating = False
Range
("f18,i21:i31,q15,g18,e34,c20:c30,k21:k31,m21:m31, o2131,q21:q31,s21").NumberFormat
= _
Range("q16").NumberFormat

End Sub

TIA

Aaron.


  #2  
Old December 9th, 2008, 02:52 AM posted to microsoft.public.excel.worksheet.functions
Shane Devenshire[_3_]
external usenet poster
 
Posts: 3,333
Default Custom Formatting

Hi,

The basic format is something like

General "g"

and in code, with a fancier format"

Selection.NumberFormat = "0.000 000 000 ""g"""

--
If this helps, please click the Yes button

Cheers,
Shane Devenshire


"Aaron" wrote:

Hi,

I have a cell that I want to have a number and a letter in, ie 0.02 g.
I need to be able to set this format based on another cells current
formatting which might be 0.000 or 0.000 0 or 0.000 00 etc. (Every 3
decimal places there goes a space before more decimal place holders
are listed.)

I currently use a macro tied to a button called Decimal Place to
change the rest of the sheet based on a keycell's decimal placing, but
I dont know how to have it do it to a cell and then add a "g" after
it.

Sub DP()

Application.ScreenUpdating = False
Range
("f18,i21:i31,q15,g18,e34,c20:c30,k21:k31,m21:m31, o2131,q21:q31,s21").NumberFormat
= _
Range("q16").NumberFormat

End Sub

TIA

Aaron.



  #3  
Old December 9th, 2008, 06:10 AM posted to microsoft.public.excel.worksheet.functions
Aaron
external usenet poster
 
Posts: 45
Default Custom Formatting

On Dec 9, 3:52*pm, Shane Devenshire
wrote:
Hi,

The basic format is something like

General "g"

and in code, with a fancier format"

Selection.NumberFormat = "0.000 000 000 ""g"""

--
If this helps, please click the Yes button

Cheers,
Shane Devenshire

"Aaron" wrote:
Hi,


I have a cell that I want to have a number and a letter in, ie 0.02 g.
I need to be able to set this format based on another cells current
formatting which might be 0.000 or 0.000 0 or 0.000 00 etc. (Every 3
decimal places there goes a space before more decimal place holders
are listed.)


I currently use a macro tied to a button called Decimal Place to
change the rest of the sheet based on a keycell's decimal placing, but
I dont know how to have it do it to a cell and then add a "g" after
it.


Sub DP()


Application.ScreenUpdating = False
*Range
("f18,i21:i31,q15,g18,e34,c20:c30,k21:k31,m21:m31, o2131,q21:q31,s21")..NumberFormat
= _
*Range("q16").NumberFormat


End Sub


TIA


Aaron.


Hmm ive been trying out different things and Im getting there slowly.
Your suggestion has helped a lot.

cheers,

Aaron.
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 06:15 PM.


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