setting interior color on second workbook/worksheet

Danny54

Active Member
Joined
Jul 3, 2019
Messages
295
Office Version
  1. 365
Platform
  1. Windows
for the life of me I can't figure out how to switch to a second workbook/sheet and set the interior color of the same row using the row number that im currently on.

example below ... when the cell value is True, set that row to lightGreen (which it does), then set the same row in the second workbook/sheet to green as well then continue looping doing the same.


With Sheets(1)
Dim cell As Range
For Each cell In Range("AX25:AX" & lastRow)
If cell.Value = "True" Then
cell.EntireRow.Interior.Color = XlRgbColor.rgbLightGreen
?????????? code to set wb2.sheet(1).cell.EntireRow.Interior.Color = XlRgbColor.rgbLightGreen <- this errors out
End If
Next
End With

Any help would be greatly appreciated.

Thanks
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
How about
VBA Code:
wb2.Sheet(1).Rows(cell.Row).Interior.Color = XlRgbColor.rgbLightGreen
 
Upvote 0
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,214,649
Messages
6,120,733
Members
448,987
Latest member
marion_davis

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top