6 cell copy macro

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
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

:
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top