#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 74
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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
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 code to dll and vba code trouble shoot. mario Excel Programming 0 May 15th 08 07:07 PM
Slow code when used as VBA code instead of macro (copying visible columns) [email protected] Excel Programming 3 April 2nd 07 05:26 PM
Can I use code/macro to change code/macro in an existing file? Scott Bedows Excel Programming 2 February 14th 07 05:50 AM
read macro code by vb code Francesco Geri Excel Programming 2 October 7th 05 10:24 AM
do anybody have a sample code for executing excel macro from vb code?<eom B Deepak Excel Programming 2 September 30th 05 09:59 AM


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