Define Certain Exact Range

S

sal21

This file contain 2 sheet and a macro that colorize a column.

my problem is possible to colorize entire column saturday and sunday i
grey to the last useful record is present i column A of shee
PRIMO_SEMESTRE and SECONDO_SEMESTRE? I have insert the condition t
colorize until 15000.

In my case i wuold want to colorized column to end in line 811...

My idea is to make a control if in the column A is present a number, o
another value....(boh!?

Attachment filename: cartel2.zip
Download attachment: http://www.excelforum.com/attachment.php?postid=63909
 
J

Jim Rech

You might try something like this:

Sub Cancella_Weekend()
Dim lngCol As Long
Dim lngColX As Long
Dim RowCount As Long
With Sheets("PRIMO_SEMESTRE")
RowCount = .Range(.Cells(5, 1), .Cells(5, 1).End(xlDown)).Count
For lngCol = 6 To 187 'columns F to GE
If Weekday(.Cells(4, lngCol), vbMonday) > 5 Then
.Cells(5, lngCol).Resize(RowCount).Interior.ColorIndex = 15
'xlNone
End If
Next lngCol
End With

''same for other sheet

--
Jim Rech
Excel MVP
| This file contain 2 sheet and a macro that colorize a column.
|
| my problem is possible to colorize entire column saturday and sunday in
| grey to the last useful record is present i column A of sheet
| PRIMO_SEMESTRE and SECONDO_SEMESTRE? I have insert the condition to
| colorize until 15000.
|
| In my case i wuold want to colorized column to end in line 811...
|
| My idea is to make a control if in the column A is present a number, or
| another value....(boh!?)
|
| Attachment filename: cartel2.zip
| Download attachment:
http://www.excelforum.com/attachment.php?postid=639095
| ---
|
|
 
S

sal21

Jim said:
*You might try something like this:

Sub Cancella_Weekend()
Dim lngCol As Long
Dim lngColX As Long
Dim RowCount As Long
With Sheets("PRIMO_SEMESTRE")
RowCount = .Range(.Cells(5, 1), .Cells(5, 1).End(xlDown)).Count
For lngCol = 6 To 187 'columns F to GE
If Weekday(.Cells(4, lngCol), vbMonday) > 5 Then
.Cells(5, lngCol).Resize(RowCount).Interior.ColorIndex = 15
'xlNone
End If
Next lngCol
End With

''same for other sheet

--
Jim Rech
Excel MVP
| This file contain 2 sheet and a macro that colorize a column.
|
| my problem is possible to colorize entire column saturday an
sunday in
| grey to the last useful record is present i column A of sheet
| PRIMO_SEMESTRE and SECONDO_SEMESTRE? I have insert the conditio
to
| colorize until 15000.
|
| In my case i wuold want to colorized column to end in line 811...
|
| My idea is to make a control if in the column A is present
number, or
| another value....(boh!?)
|
| Attachment filename: cartel2.zip
| Download attachment:
http://www.excelforum.com/attachment.php?postid=639095
| ---
|
| *
 

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