interior color of macro

V

violet

for my macro "changes" it will compare the last 2 column of the excel sheet
and change the interior color if the 2 values are different. however, if i
delete the last column and run the macro again, the previous interior change
will still be there. i wish to reset the interior color of the row that has
been changed when i run the macro again.how can i do that?
 
H

halimnurikhwan

Hi Violet,

If you change color of the last 2 cells in a sheet
then you delete the row that both not same in value
Excel just remember that row you deleted and the next
Macro will read that deleted row with other value from
its offset(1,0)...

So you have to read the whole row that last 2.

Then delete 'em in a time.

Regards,

Halim


violet menuliskan:
 
J

JLGWhiz

You can add a line at the beginning of your macro to select the range that
includes the two columns and use something like

MyRange.Interior.ColorIndex = xlColorIndexNone

That will reset all of the cells in those columns.
 

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