Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default copying some cells


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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,089
Default copying some cells

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
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
copying cells waterguy Excel Discussion (Misc queries) 3 November 20th 08 01:05 AM
How do I skip blank cells when copying over a range of cells? tawells Excel Discussion (Misc queries) 2 June 7th 05 09:36 PM
Excel should allow cloaking of certain cells when copying cells b. LDI Woody Excel Worksheet Functions 1 March 11th 05 04:55 PM
copying cells Norman Jones Excel Programming 0 July 27th 04 06:09 PM
Copying cells Jahson Excel Programming 1 February 5th 04 11:21 PM


All times are GMT +1. The time now is 01:17 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"