Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Select Activecell and 65 Rows to the Right
I want to go to the last used cell in Column A, move over 5 to the right, and
then select the range from Column F to Column BR. I'm trying to run the code below, keeps failing on this line: ActiveCell.Resize(0, 65).Select Code: Cells(Rows.Count, "A").End(xlUp).Select ActiveCell.Offset(0, 5).Select ActiveCell.Resize(0, 65).Select Selection.Copy Sheets("Scoring_Sheet").Select Range("B3").Select Selection.PasteSpecial Paste:=xlPasteAll, Operation:=xlNone, SkipBlanks:= _ False, Transpose:=True I must be missing something pretty basic. I thought this was done with resize and select. Any suggestions? Thanks, Ryan--- -- RyGuy |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Select Activecell and 65 Rows to the Right
Neither the move 5 or the resize is necessary:
Sub asdf() n = Cells(Rows.Count, "A").End(xlUp).Row Range("F" & n & ":BR" & n).Select End Sub -- Gary''s Student - gsnu200822 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Select Activecell and 65 Rows to the Right
Hummm, you are right. Works fine now. Thanks a lot!
Besides being less efficient, what is wrong with this: ActiveCell.Offset(0, 5).Select ActiveCell.Resize(0, 65).Select Thanks, Ryan--- -- RyGuy "Gary''s Student" wrote: Neither the move 5 or the resize is necessary: Sub asdf() n = Cells(Rows.Count, "A").End(xlUp).Row Range("F" & n & ":BR" & n).Select End Sub -- Gary''s Student - gsnu200822 |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Select Activecell and 65 Rows to the Right
But, if you wanted to use Offset and Resize, that could be done quite
compactly... Sub asdf() Cells(Rows.Count, "A").End(xlUp).Offset(, 5).Resize(1, 65).Select End Sub -- Rick (MVP - Excel) "Gary''s Student" wrote in message ... Neither the move 5 or the resize is necessary: Sub asdf() n = Cells(Rows.Count, "A").End(xlUp).Row Range("F" & n & ":BR" & n).Select End Sub -- Gary''s Student - gsnu200822 |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Select Activecell and 65 Rows to the Right
You can't use 0 rows high for the Resize... either leave it out and Excel
will figure it out... Resize(,65)... or use 1 for the height... Resize(1, 65). You can combine both of those operations into a single statement... ActiveCell.Offset(, 5).Resize(, 65).Select -- Rick (MVP - Excel) "ryguy7272" wrote in message ... Hummm, you are right. Works fine now. Thanks a lot! Besides being less efficient, what is wrong with this: ActiveCell.Offset(0, 5).Select ActiveCell.Resize(0, 65).Select Thanks, Ryan--- -- RyGuy "Gary''s Student" wrote: Neither the move 5 or the resize is necessary: Sub asdf() n = Cells(Rows.Count, "A").End(xlUp).Row Range("F" & n & ":BR" & n).Select End Sub -- Gary''s Student - gsnu200822 |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
Select Activecell and 65 Rows to the Right
Ah! Thanks for the insight Rick!
Happy Holidays!! Ryan-- -- RyGuy "Rick Rothstein" wrote: But, if you wanted to use Offset and Resize, that could be done quite compactly... Sub asdf() Cells(Rows.Count, "A").End(xlUp).Offset(, 5).Resize(1, 65).Select End Sub -- Rick (MVP - Excel) "Gary''s Student" wrote in message ... Neither the move 5 or the resize is necessary: Sub asdf() n = Cells(Rows.Count, "A").End(xlUp).Row Range("F" & n & ":BR" & n).Select End Sub -- Gary''s Student - gsnu200822 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Select ActiveCell Range | Excel Programming | |||
ActiveCell.Row in Range().Select? | Excel Programming | |||
Range Select with ActiveCell and Offset property | Excel Programming | |||
select range next to activecell | Excel Programming | |||
Select Activecell in Range | Excel Programming |