Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Selecting non-adjacent rows
How do I programmatically select non-adjacent rows, in
order to change the format? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Selecting non-adjacent rows
Jon
Here's one way: Sub test() Dim FormatRange As Range With Sheets("Sheet1") Set FormatRange = Union(.Rows(3), .Rows(6), .Rows(9)) FormatRange.Interior.ColorIndex = 3 End With End Sub -- Best Regards Leo Heuser MVP Excel Followup to newsgroup only please. "Jon" skrev i en meddelelse ... How do I programmatically select non-adjacent rows, in order to change the format? |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Selecting non-adjacent rows
I usually built up a range using Union and then select it:
Sub a() Dim Counter As Integer Dim Rg As Range Set Rg = ActiveCell For Counter = 1 To 10 Set Rg = Union(Rg, ActiveCell.Offset(Counter * 2)) Next Rg.Select End Sub -- Jim Rech Excel MVP |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Selecting non-adjacent rows
Jon, here is one way
Range("2:2,6:6,11:11,16:16,20:20").NumberFormat = "0.00_);[Red](0.00)" -- Paul B Always backup your data before trying something new Using Excel 97 & 2000 Please post any response to the newsgroups so others can benefit from it ** remove news from my email address to reply by email ** "Jon" wrote in message ... How do I programmatically select non-adjacent rows, in order to change the format? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Add cells on two adjacent rows but non-adjacent columns | Excel Worksheet Functions | |||
Selecting non-adjacent data | Excel Discussion (Misc queries) | |||
Keyboard Navigation - selecting non-adjacent rows | Excel Discussion (Misc queries) | |||
selecting adjacent cells | New Users to Excel | |||
selecting non adjacent cells | Excel Worksheet Functions |