View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
SIGE SIGE is offline
external usenet poster
 
Posts: 206
Default Set formatting variable

Hi Norman,

The black cells I am coloring should indicate how wide (wide) the last
column is going of my UsedRange ... always coloring row 1 & 2.(titles
will be written in here)

I think the code should be as follows:

If LastCol 8 Then
Set rng2 = Range("A1", Cells(2, LastCol))

The thing is that the UsedRange can change while working on the sheet
.... Worksheet_SelectionChange might be a solution to update this
behaviour...& Also ressetting the UsedRange.
I am afraid though that this will invoke emptying the Undo-list!

Way around?
Brgds Sige