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

Im looping through a column of numbers. Each number is stored in a
variable, Y_CellTest, as that row is dealt with and a comparative test is
performed. The value of Y_CellTest can go out a varying number of positions
to the right of the decimal point. How do I alter that variable Y_CellTest,
to read only X numbers of places to the right of the decimal point?
Currently the line reads Y_CellTest = Worksheets(2).Cells(Loop_rO,
coLArray(X_col)). Y_CellTest = 43.3762286964325 but I want it to read only
say 4 places to the right of the decimal point, Y_CellTest = 43.3762.

Appreciatively,
Arturo
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 108
Default Decimal Dilemma

Got it:

Y_CellTest = Round(Worksheets(2).Cells(Loop_rO, coLArray(X_col)), 4)

"Arturo" wrote:

Im looping through a column of numbers. Each number is stored in a
variable, Y_CellTest, as that row is dealt with and a comparative test is
performed. The value of Y_CellTest can go out a varying number of positions
to the right of the decimal point. How do I alter that variable Y_CellTest,
to read only X numbers of places to the right of the decimal point?
Currently the line reads Y_CellTest = Worksheets(2).Cells(Loop_rO,
coLArray(X_col)). Y_CellTest = 43.3762286964325 but I want it to read only
say 4 places to the right of the decimal point, Y_CellTest = 43.3762.

Appreciatively,
Arturo

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
What if Dilemma Gareth[_2_] Excel Discussion (Misc queries) 2 September 25th 08 04:37 PM
BIG Dilemma.....HELP!! Amber Excel Worksheet Functions 5 May 30th 07 01:26 AM
If Then Dilemma Excel Confused Excel Worksheet Functions 21 December 29th 06 12:11 AM
Spreadsheet Dilemma msbates2004 Excel Discussion (Misc queries) 1 May 27th 05 02:55 AM
XL add-in dilemma brio Excel Programming 1 February 17th 04 09:13 PM


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