ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Strange Request (https://www.excelbanter.com/excel-programming/364285-strange-request.html)

bodhisatvaofboogie

Strange Request
 
I am using this formula successfully:

Set rng = Cells(6, 1).Resize(1, 1)
For i = 49 To 5000 Step 43
Set rng = Union(rng, Cells(i, 6).Resize(1, 1))
Next
rng.EntireRow.Select

It selects row 6, 49, then every 43rd row there after. It selects the
entire row, I want it to select just a range of all those rows, but only
columsn A - F What change do I need to make? I'm asuming that I have to
change the "rng.EntireRow.Select " to some kind of column range, but I'm not
sure what. THANKS!!!!



Paul Mathews

Strange Request
 
How about this:

rng.resize(1,6).select

"bodhisatvaofboogie" wrote:

I am using this formula successfully:

Set rng = Cells(6, 1).Resize(1, 1)
For i = 49 To 5000 Step 43
Set rng = Union(rng, Cells(i, 6).Resize(1, 1))
Next
rng.EntireRow.Select

It selects row 6, 49, then every 43rd row there after. It selects the
entire row, I want it to select just a range of all those rows, but only
columsn A - F What change do I need to make? I'm asuming that I have to
change the "rng.EntireRow.Select " to some kind of column range, but I'm not
sure what. THANKS!!!!



bodhisatvaofboogie

Strange Request
 
wonderful, THANKS!!! Can't believe I missed that. I think I've been
staring at this macro too long...time to take a break, I'm starting to ignore
things. HA!!!

"Paul Mathews" wrote:

How about this:

rng.resize(1,6).select

"bodhisatvaofboogie" wrote:

I am using this formula successfully:

Set rng = Cells(6, 1).Resize(1, 1)
For i = 49 To 5000 Step 43
Set rng = Union(rng, Cells(i, 6).Resize(1, 1))
Next
rng.EntireRow.Select

It selects row 6, 49, then every 43rd row there after. It selects the
entire row, I want it to select just a range of all those rows, but only
columsn A - F What change do I need to make? I'm asuming that I have to
change the "rng.EntireRow.Select " to some kind of column range, but I'm not
sure what. THANKS!!!!



Paul Mathews

Strange Request
 
Whoops, sorry, I meant:

rng.Cells(1, 1).Resize(1, 6).Select

"bodhisatvaofboogie" wrote:

I am using this formula successfully:

Set rng = Cells(6, 1).Resize(1, 1)
For i = 49 To 5000 Step 43
Set rng = Union(rng, Cells(i, 6).Resize(1, 1))
Next
rng.EntireRow.Select

It selects row 6, 49, then every 43rd row there after. It selects the
entire row, I want it to select just a range of all those rows, but only
columsn A - F What change do I need to make? I'm asuming that I have to
change the "rng.EntireRow.Select " to some kind of column range, but I'm not
sure what. THANKS!!!!



Tom Ogilvy

Strange Request
 
I think what you really want is:

Set rng = Cells(6, 1)
For i = 49 To 5000 Step 43
Set rng = Union(rng, Cells(i, 1))
Next
Intersect(rng.EntireRow,Range("A:F")).Delete Shift:=xlup



--
Regards,
Tom Ogilvy


"bodhisatvaofboogie" wrote:

wonderful, THANKS!!! Can't believe I missed that. I think I've been
staring at this macro too long...time to take a break, I'm starting to ignore
things. HA!!!

"Paul Mathews" wrote:

How about this:

rng.resize(1,6).select

"bodhisatvaofboogie" wrote:

I am using this formula successfully:

Set rng = Cells(6, 1).Resize(1, 1)
For i = 49 To 5000 Step 43
Set rng = Union(rng, Cells(i, 6).Resize(1, 1))
Next
rng.EntireRow.Select

It selects row 6, 49, then every 43rd row there after. It selects the
entire row, I want it to select just a range of all those rows, but only
columsn A - F What change do I need to make? I'm asuming that I have to
change the "rng.EntireRow.Select " to some kind of column range, but I'm not
sure what. THANKS!!!!




All times are GMT +1. The time now is 01:33 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com