Reduce size of Range - Syntax question

parsellj

New Member
Joined
Jan 14, 2013
Messages
3
I hope this is a trivial question!
Given a Worksheet variable - WS,
and a Single Column Range on that Worksheet - V (eg G1:G260),
and an Index -- i where i is the index of the first row of interest in that range (eg 12),
What is the VB or VBA syntax for setting V to be the Range starting with G12 and ending at G260.

I am looking for the "proper" idomatic way to do this and am having a mental block.
TIA,
Jim
 

Some videos you may like

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.

pgc01

MrExcel MVP
Joined
Apr 25, 2006
Messages
19,777
Hi Jim
Welcome to the board

Try:

Code:
Sub Test()
Dim ws As Worksheet
Dim r As Range
Dim i As Long

Set ws = Worksheets("Sheet3")
Set r = ws.Range("G1:G260")
i = 12

' syntax for setting V to be the Range starting with G12 and ending at G260.
Set r = ws.Range(r(i), r(r.Rows.Count))

MsgBox r.Address(external:=True)
End Sub
 

Watch MrExcel Video

Forum statistics

Threads
1,099,114
Messages
5,466,760
Members
406,497
Latest member
Bryanlim

This Week's Hot Topics

Top