Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 331
Default How do I denote values stored in columns in my macro?

I need to write a macro that will calculate a value based on one of 2
formulas. The formula is dependent on the value in another cell. How do I
do this
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default How do I denote values stored in columns in my macro?

if range("A1").Value 10 then
code to use formula 1
else
code to use formula 2
End if

--
Regards,
Tom Ogilvy

"Greg" wrote in message
...
I need to write a macro that will calculate a value based on one of 2
formulas. The formula is dependent on the value in another cell. How do

I
do this



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 331
Default How do I denote values stored in columns in my macro?

I need to multiply:
C7*I7*.25
How do I code the values in C7 and I7 into the formula for K7 (the column
I'm writing a macro for?
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default How do I denote values stored in columns in my macro?

Range("K7").Formula = "=C7*I7*.25"

if you want to do the calculation in vba

v = Range("C7").Value * Range("I7").Value * 0.25
Range("K7").Value = v

--
Regards,
Tom Ogilvy


"Greg" wrote in message
...
I need to multiply:
C7*I7*.25
How do I code the values in C7 and I7 into the formula for K7 (the column
I'm writing a macro for?



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
macro to hide columns with zero values? K Dawson Excel Discussion (Misc queries) 1 March 23rd 10 06:31 PM
Is there an easy way to denote significance on charts jpaderi Charts and Charting in Excel 2 August 5th 09 07:01 AM
Need to combine dates stored in seperate columns mrcosna Excel Discussion (Misc queries) 4 November 3rd 08 04:02 PM
How to use values stored in a combo box control? Arlen Excel Discussion (Misc queries) 4 July 25th 08 09:34 PM
vba clearing out values stored in array chick-racer[_44_] Excel Programming 2 December 1st 03 09:05 PM


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