Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 84
Default Formating problem

I am using the following

Now
A) Format((BeatMetersTotal(MyNum) / BinTotal(MyNum)), "0.0")
Previously
B) Format((BeatMetersTotal(MyNum) / BinTotal(MyNum)), "0.00")

I want my output to show one decimal place. I get the following with the
above format: A) 2 B) 1.98. How do I force it so I get what I want. I am
using the same data to generate the same report.

Thanks

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Formating problem

Are you plopping the value into a cell on a worksheet?

If yes, then make sure you change the numberformat of the cell:

with activesheet.range("x99")
.numberformat = "0.0"
.value = Format((BeatMetersTotal(MyNum) / BinTotal(MyNum)), "0.0")
End with

If you're not doing putting the value in a cell, then I think you'll have to
explain more.

Nils Titley wrote:

I am using the following

Now
A) Format((BeatMetersTotal(MyNum) / BinTotal(MyNum)), "0.0")
Previously
B) Format((BeatMetersTotal(MyNum) / BinTotal(MyNum)), "0.00")

I want my output to show one decimal place. I get the following with the
above format: A) 2 B) 1.98. How do I force it so I get what I want. I am
using the same data to generate the same report.

Thanks


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 84
Default Formating problem

That makes good sense but can't I just change the format for a column which
would apply to all inputs. I have 13 columns I am using 1 date, 3 times, 7
integers and 2 that need the 1 decimal.

In you replay what does ("x99") actually tell the range?

Thanks


"Dave Peterson" wrote:

Are you plopping the value into a cell on a worksheet?

If yes, then make sure you change the numberformat of the cell:

with activesheet.range("x99")
.numberformat = "0.0"
.value = Format((BeatMetersTotal(MyNum) / BinTotal(MyNum)), "0.0")
End with

If you're not doing putting the value in a cell, then I think you'll have to
explain more.

Nils Titley wrote:

I am using the following

Now
A) Format((BeatMetersTotal(MyNum) / BinTotal(MyNum)), "0.0")
Previously
B) Format((BeatMetersTotal(MyNum) / BinTotal(MyNum)), "0.00")

I want my output to show one decimal place. I get the following with the
above format: A) 2 B) 1.98. How do I force it so I get what I want. I am
using the same data to generate the same report.

Thanks


--

Dave Peterson

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 84
Default Formating problem

Ignore the what does ("x99") mean!

"Nils Titley" wrote:

That makes good sense but can't I just change the format for a column which
would apply to all inputs. I have 13 columns I am using 1 date, 3 times, 7
integers and 2 that need the 1 decimal.

In you replay what does ("x99") actually tell the range?

Thanks


"Dave Peterson" wrote:

Are you plopping the value into a cell on a worksheet?

If yes, then make sure you change the numberformat of the cell:

with activesheet.range("x99")
.numberformat = "0.0"
.value = Format((BeatMetersTotal(MyNum) / BinTotal(MyNum)), "0.0")
End with

If you're not doing putting the value in a cell, then I think you'll have to
explain more.

Nils Titley wrote:

I am using the following

Now
A) Format((BeatMetersTotal(MyNum) / BinTotal(MyNum)), "0.0")
Previously
B) Format((BeatMetersTotal(MyNum) / BinTotal(MyNum)), "0.00")

I want my output to show one decimal place. I get the following with the
above format: A) 2 B) 1.98. How do I force it so I get what I want. I am
using the same data to generate the same report.

Thanks


--

Dave Peterson

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Formating problem

Sure.

Just format the column the way you want.

Worksheets("sheetnamehere").range("m1,x1").entirec olumn.numberformat = "0.00"

You could even format the ranges manually and forget about doing it in code.



Nils Titley wrote:

That makes good sense but can't I just change the format for a column which
would apply to all inputs. I have 13 columns I am using 1 date, 3 times, 7
integers and 2 that need the 1 decimal.

In you replay what does ("x99") actually tell the range?

Thanks

"Dave Peterson" wrote:

Are you plopping the value into a cell on a worksheet?

If yes, then make sure you change the numberformat of the cell:

with activesheet.range("x99")
.numberformat = "0.0"
.value = Format((BeatMetersTotal(MyNum) / BinTotal(MyNum)), "0.0")
End with

If you're not doing putting the value in a cell, then I think you'll have to
explain more.

Nils Titley wrote:

I am using the following

Now
A) Format((BeatMetersTotal(MyNum) / BinTotal(MyNum)), "0.0")
Previously
B) Format((BeatMetersTotal(MyNum) / BinTotal(MyNum)), "0.00")

I want my output to show one decimal place. I get the following with the
above format: A) 2 B) 1.98. How do I force it so I get what I want. I am
using the same data to generate the same report.

Thanks


--

Dave Peterson


--

Dave Peterson


  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 84
Default Formating problem

Dave,

I still have a problem. Okay so I formatted the numbers now I am need to
center or right justify a column when I don't know the range. When I was
printing the date in a column it automaticaly seems to right justify. The
user in South Africa asked if I would just have the date. It appears that
the date for them includes the time. So I formated the date to be "ddmmyy"
which is common for them. When I did that the date became left justified in
the column.

I am creating the worksheet that accepts the data.

How do I do this. I serached the help...

Thanks, you are helping me a lot.

"Dave Peterson" wrote:

Sure.

Just format the column the way you want.

Worksheets("sheetnamehere").range("m1,x1").entirec olumn.numberformat = "0.00"

You could even format the ranges manually and forget about doing it in code.



Nils Titley wrote:

That makes good sense but can't I just change the format for a column which
would apply to all inputs. I have 13 columns I am using 1 date, 3 times, 7
integers and 2 that need the 1 decimal.

In you replay what does ("x99") actually tell the range?

Thanks

"Dave Peterson" wrote:

Are you plopping the value into a cell on a worksheet?

If yes, then make sure you change the numberformat of the cell:

with activesheet.range("x99")
.numberformat = "0.0"
.value = Format((BeatMetersTotal(MyNum) / BinTotal(MyNum)), "0.0")
End with

If you're not doing putting the value in a cell, then I think you'll have to
explain more.

Nils Titley wrote:

I am using the following

Now
A) Format((BeatMetersTotal(MyNum) / BinTotal(MyNum)), "0.0")
Previously
B) Format((BeatMetersTotal(MyNum) / BinTotal(MyNum)), "0.00")

I want my output to show one decimal place. I get the following with the
above format: A) 2 B) 1.98. How do I force it so I get what I want. I am
using the same data to generate the same report.

Thanks

--

Dave Peterson


--

Dave Peterson

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Formating problem

I'm not sure you you can put anything in a cell if you don't know where it
should go.

But if it's going in the activecell (say), you could use:

with activecell
.numberformat = "mm/dd/yyyy hh:mm:ss"
.value = now
.HorizontalAlignment = xlCenter
'or????
.HorizontalAlignment = xlGeneral
end with

I can think of a couple of things that could cause the date to be left
justified.

The cell could be formatted as text or it could actually have the horizontal
alignment set to left justify.

You may want to look at all the formatting options that you care about. Then
include the code to set them the way you like--including the columnwidth????




Nils Titley wrote:

Dave,

I still have a problem. Okay so I formatted the numbers now I am need to
center or right justify a column when I don't know the range. When I was
printing the date in a column it automaticaly seems to right justify. The
user in South Africa asked if I would just have the date. It appears that
the date for them includes the time. So I formated the date to be "ddmmyy"
which is common for them. When I did that the date became left justified in
the column.

I am creating the worksheet that accepts the data.

How do I do this. I serached the help...

Thanks, you are helping me a lot.

"Dave Peterson" wrote:

Sure.

Just format the column the way you want.

Worksheets("sheetnamehere").range("m1,x1").entirec olumn.numberformat = "0.00"

You could even format the ranges manually and forget about doing it in code.



Nils Titley wrote:

That makes good sense but can't I just change the format for a column which
would apply to all inputs. I have 13 columns I am using 1 date, 3 times, 7
integers and 2 that need the 1 decimal.

In you replay what does ("x99") actually tell the range?

Thanks

"Dave Peterson" wrote:

Are you plopping the value into a cell on a worksheet?

If yes, then make sure you change the numberformat of the cell:

with activesheet.range("x99")
.numberformat = "0.0"
.value = Format((BeatMetersTotal(MyNum) / BinTotal(MyNum)), "0.0")
End with

If you're not doing putting the value in a cell, then I think you'll have to
explain more.

Nils Titley wrote:

I am using the following

Now
A) Format((BeatMetersTotal(MyNum) / BinTotal(MyNum)), "0.0")
Previously
B) Format((BeatMetersTotal(MyNum) / BinTotal(MyNum)), "0.00")

I want my output to show one decimal place. I get the following with the
above format: A) 2 B) 1.98. How do I force it so I get what I want. I am
using the same data to generate the same report.

Thanks

--

Dave Peterson


--

Dave Peterson


--

Dave Peterson
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
Conditional formating problem excelent Excel Discussion (Misc queries) 3 September 24th 09 02:15 PM
Formating Problem Dave Excel Discussion (Misc queries) 1 January 28th 08 01:02 PM
Conditional Formating Problem MESTRELLA29 Excel Discussion (Misc queries) 6 October 13th 06 11:31 PM
formating problem, PLEASE help. guy12345 Excel Discussion (Misc queries) 5 August 31st 06 05:50 PM
Chart formating problem KrunoG Charts and Charting in Excel 0 February 10th 06 08:38 PM


All times are GMT +1. The time now is 08:01 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"