Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro code
How can I set up a macro code to do the following:
If a specific value is found in Column A (say: SBY), then column C should be set to equal whatever value is found in Column B (this value could be several different things). Thank you! |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro code
Not tested just written here but should do what you want it to do! Sub Copy_B_To_C() Dim Rng As Range, MyCell as range Set rng= Range("A1:A" & range("A" & rows.count).end(xlup).row) for each mycell in rng if mycell.value ="SBY" then mycell.offset(0,3)=mycell.offset(0,2) end if next mycell end sub -- Simon Lloyd Regards, Simon Lloyd 'www.thecodecage.com' (http://www.thecodecage.com) ------------------------------------------------------------------------ Simon Lloyd's Profile: http://www.thecodecage.com/forumz/member.php?userid=1 View this thread: http://www.thecodecage.com/forumz/sh...ad.php?t=24509 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Macro code to dll and vba code trouble shoot. | Excel Programming | |||
Slow code when used as VBA code instead of macro (copying visible columns) | Excel Programming | |||
Can I use code/macro to change code/macro in an existing file? | Excel Programming | |||
read macro code by vb code | Excel Programming | |||
do anybody have a sample code for executing excel macro from vb code?<eom | Excel Programming |