MrExcel Publishing
Your One Stop for Excel Tips & Solutions

VBA for actions on one cell value or formula


Posted by Bryan on February 08, 2001 3:10 PM

What's the VBA code to action the following on any cell:
cell contain's any value and I want to attached "*F2", i.e value 125 becomes =125*F2. F2 will be False or True (via a click button) so I am able to turn on or off values in a column.


Posted by tom on February 08, 2001 3:23 PM

this seemed to work for me

test = Range("C36").Text
test = "=" + test + "*F2"
Cells(36, 3) = test

i made test a string variable
& C36 was the cell with the value i wanted *F2 to be on the end of
& that procedure seemed to work
this is presuming of course that u mean F2 to be the cell F2. wouldn't make much difference if it was a variable, i guess it would still be the same procedure

Posted by tom on February 08, 2001 3:27 PM

hmm

hmm.. just remembered, this is for a known cell of course.
did u want it to operate on a given cell or what?

Posted by Bryan on February 08, 2001 11:08 PM

Re: hmm

Tom,
I just need to apply the macro to any cell or range of cells. Thanks for your help so far!