Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,560
Default Variable as result of Divide (Sum) Function

I have a macro that takes values from spreadsheets sent to our office and
posts the values to a consolidated spreadsheet.
I need a value that is the result of a sum function (would look like this if
in a cell cum(c106/c92). I have to perform the function and then assign it to
a variable named iValueCMGM. The value of this variable is then pasted into
the consolidated workbook.
I tried this but it didn't work:
iValueCMGM = .Range("C106" / "C92")

Can anyone help?
Thanks!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Variable as result of Divide (Sum) Function

dim iValueCMGM as Double

With worksheets("Sheet1")
if isnumeric(.Range("C106").Value) and _
isnumeric(.Range("C92").Value) then
if Range("C92").Value < 0 then
iValueCMGM = .Range("C106").Value / .Range("C92").Value
end if
end if
End With

--
Regards,
Tom Ogilvy


"David" wrote in message
...
I have a macro that takes values from spreadsheets sent to our office and
posts the values to a consolidated spreadsheet.
I need a value that is the result of a sum function (would look like this
if
in a cell cum(c106/c92). I have to perform the function and then assign it
to
a variable named iValueCMGM. The value of this variable is then pasted
into
the consolidated workbook.
I tried this but it didn't work:
iValueCMGM = .Range("C106" / "C92")

Can anyone help?
Thanks!



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,560
Default Variable as result of Divide (Sum) Function

Thank you oh mighty one!!

"Tom Ogilvy" wrote:

dim iValueCMGM as Double

With worksheets("Sheet1")
if isnumeric(.Range("C106").Value) and _
isnumeric(.Range("C92").Value) then
if Range("C92").Value < 0 then
iValueCMGM = .Range("C106").Value / .Range("C92").Value
end if
end if
End With

--
Regards,
Tom Ogilvy


"David" wrote in message
...
I have a macro that takes values from spreadsheets sent to our office and
posts the values to a consolidated spreadsheet.
I need a value that is the result of a sum function (would look like this
if
in a cell cum(c106/c92). I have to perform the function and then assign it
to
a variable named iValueCMGM. The value of this variable is then pasted
into
the consolidated workbook.
I tried this but it didn't work:
iValueCMGM = .Range("C106" / "C92")

Can anyone help?
Thanks!




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
Divide variable numbers into groups Marie Bayes Excel Discussion (Misc queries) 2 July 28th 09 06:53 PM
Divide Function JMW Excel Discussion (Misc queries) 2 October 16th 08 10:08 PM
Divide by variable [email protected] Excel Discussion (Misc queries) 3 June 25th 07 09:12 PM
read string from database and divide result into cells? ladyhawke Excel Programming 7 July 1st 06 12:29 PM
Function 2 divide a number (ie $1.00) by % (ie 25%) to = ($4.00)? Gonecoastal1 Excel Worksheet Functions 12 March 18th 06 03:27 AM


All times are GMT +1. The time now is 11:13 PM.

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"