Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 46
Default 6 cell copy macro

I have six cells and only one of those cells is colored and has data...
Example
F G H I J K Y
1 blank blank data blank blank blank Copy cell that's not blank here
2 blank data blank blank blank blank Copy cell that's not blank here
3 blank blank blank blank blank data Copy cell that's not blank here
ect.
Is thier anyway to do this and to keep the cell color as well as the data?
Thanks,
DJ
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 6 cell copy macro


This is very similar to using the if statement as a worksheet functio
except for the color aspect. From your post it looks as though yo
would like to copy the cell (and its interior fill color) that contain
data to the adjacent column. A little For-Next loop macro would do th
trick, here's an example:

Sub BringData
'define the range to consider in the loop
' here we choose the first cell for the first three rows:
Dim Counter as Integer

For Counter = 1 to 3

If Cells(Counter,1).value < "" then
Cells(Counter,2).Value = Cells(Counter,1).Value

Cells(Counter,2).Interior.ColorIndex=Cells(Counter ,1).Interior.ColorIndex
Else
Cells(Counter,2).Interior.ColorIndex=2
End If

Next Counter

:

--
crispb
-----------------------------------------------------------------------
crispbd's Profile: http://www.excelforum.com/member.php...fo&userid=1088
View this thread: http://www.excelforum.com/showthread.php?threadid=27366

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 46
Default 6 cell copy macro

Thanks crispbd
Not going to work as it copies what's in cell A to B
I need something that will take the data and cell color to coulmn M
let's say row 1, column a b c d e f are all blank except c... I need c
copied to coulmn M.. next row, row 2, a,b,c,d,e,f are all blank except b.. I
need b copied to coulmn M along with it's color... In other words I just want
what ever data is in a-f coulmn and thier will only be one cell with data and
colored on each row ..
thanks for the help,
dj

"crispbd" wrote:


This is very similar to using the if statement as a worksheet function
except for the color aspect. From your post it looks as though you
would like to copy the cell (and its interior fill color) that contains
data to the adjacent column. A little For-Next loop macro would do the
trick, here's an example:

Sub BringData
'define the range to consider in the loop
' here we choose the first cell for the first three rows:
Dim Counter as Integer

For Counter = 1 to 3

If Cells(Counter,1).value < "" then
Cells(Counter,2).Value = Cells(Counter,1).Value

Cells(Counter,2).Interior.ColorIndex=Cells(Counter ,1).Interior.ColorIndex
Else
Cells(Counter,2).Interior.ColorIndex=2
End If

Next Counter

:)


--
crispbd
------------------------------------------------------------------------
crispbd's Profile: http://www.excelforum.com/member.php...o&userid=10880
View this thread: http://www.excelforum.com/showthread...hreadid=273665


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
How do I copy a macro into another cell? Jango53 Excel Discussion (Misc queries) 0 September 2nd 08 10:05 PM
Is there a macro i can use to copy a cell +1 Bill M. Excel Discussion (Misc queries) 4 February 12th 08 02:59 PM
Using macro to copy a part of a cell content to next cell Charles Excel Discussion (Misc queries) 6 May 31st 06 05:57 AM
Macro help - copy a cell down gjcase Excel Discussion (Misc queries) 3 September 4th 05 05:09 AM
Macro Help to Copy to Last Cell Dave Y[_3_] Excel Programming 4 July 3rd 04 02:05 AM


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