LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2
Default formatting macro help

Hi,

I have a report that has a different number of columns each day. I
have the macro highlighting rows, 2 highlighted, 2 blank. But I only
want the highlighting to extend to x number of columns. One problem
is each data set has blanks in it, so I can't use the EndxlToRight for
every row. I need to replace the "Z" in the statement Range("A1:Z2")
with the x variable.
Can you please help?


Dim x As Long
Range("A4").Select
Range(Selection, Selection.End(xlToRight)).Select
x = Selection.Columns.Count
Range("A1").Select
Do
ActiveCell.Offset(4, 0).Range("A1:Z2").Select
With Selection.Interior
.ColorIndex = 15
.Pattern = xlSolid
End With
Loop Until ActiveCell.Offset(4, 0) = ""

Thanks!
Bret
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Formatting using Macro simplymidori[_2_] Excel Discussion (Misc queries) 4 April 11th 08 12:22 AM
Formatting for a Macro Maggie Excel Discussion (Misc queries) 3 February 28th 07 02:00 AM
Formatting via a macro mike_vr Excel Discussion (Misc queries) 3 November 8th 06 04:19 PM
Conditional Formatting in Macro shantanu oak Excel Discussion (Misc queries) 2 July 14th 06 01:11 PM
Date Formatting in a Macro [email protected] Excel Discussion (Misc queries) 3 May 19th 06 02:09 AM


All times are GMT +1. The time now is 11:46 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"