Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Hi, I have a spreadsheet whit a list of some colors in the same column the list length depends from another macro (b2 to ..), I need a cod that every time in the list is the color blue, its copied 2 column ahead in the same row. Example. if in the list I have color blue in the cells b4, b7, b10 b20 I need to copy that word blue in the cells d2, d7,d10,d2 -- caciqu ----------------------------------------------------------------------- cacique's Profile: http://www.excelforum.com/member.php...fo&userid=2486 View this thread: http://www.excelforum.com/showthread.php?threadid=38574 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
One way:
Sub CopyBlue() Dim c As Range Application.ScreenUpdating = False For Each c In Range("B2:B" & Range("B" & Rows.Count).End(xlUp).Row) If c.Value = "blue" Then c.Offset(0, 2).Value = c.Value Next 'c Application.ScreenUpdating = True End Sub Regards Trevor "cacique" wrote in message ... Hi, I have a spreadsheet whit a list of some colors in the same column, the list length depends from another macro (b2 to ..), I need a code that every time in the list is the color blue, its copied 2 columns ahead in the same row. Example. if in the list I have color blue in the cells b4, b7, b10 , b20 I need to copy that word blue in the cells d2, d7,d10,d20 -- cacique ------------------------------------------------------------------------ cacique's Profile: http://www.excelforum.com/member.php...o&userid=24861 View this thread: http://www.excelforum.com/showthread...hreadid=385746 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
copying cells | Excel Discussion (Misc queries) | |||
How do I skip blank cells when copying over a range of cells? | Excel Discussion (Misc queries) | |||
Excel should allow cloaking of certain cells when copying cells b. | Excel Worksheet Functions | |||
copying cells | Excel Programming | |||
Copying cells | Excel Programming |