Using VBA - Copying Formatting from Summary to Individual Sheet

L

LondonHawk

Hello,

I have a summary timetable sheet, and each customer has a differen
colour. If someone is due to visit them on day x, then the cell i
shaded in that particular customer.

I then have an individual sheet for each customer and I want to be abl
to copy the formatting from the summary to the individual custome
sheet without having to cut and paste for each individual customer.

This is what I have so far

Dim Cell As Object
Dim CurrentCell As Object

Range("B10:Y200").Select


For Each Cell In Selection

If Cell.Interior.ColorIndex = 52 Then


Cell = CurrentCell
Sheets("CustA").Select
Range(CurrentCell).Select
Cell.Interior.ColorIndex = 52
Sheets("Summary").Select

End If

Next Cell

Any ideas, thanks in advance

Ada
 
J

Jonathan Rynd

Dim Cell As Object
Dim CurrentCell As Object

Range("B10:Y200").Select


For Each Cell In Selection

If Cell.Interior.ColorIndex = 52 Then


Cell = CurrentCell
Sheets("CustA").Select
Range(CurrentCell).Select
Cell.Interior.ColorIndex = 52
Sheets("Summary").Select

End If

Next Cell

It looks like you are never setting CurrentCell to anything. I think you
want to use ActiveCell. And plus you are reusing Cell twice. What do
you mean by "Range(CurrentCell)"?
 

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

Top