Solved

Excel VBA - Defining table based on CurrentCell.ActiveRegion

Posted on 2012-03-22
1
245 Views
Last Modified: 2012-03-22
What is the cleanest way to define a range that is the current region without the top row?
If I start with ActiveCell.CurrentRegion, how do I set rTableSansTopRow (below)?

Set rWholeTable=ActiveCell.CurrentRegion

Set rTableSansTopRow=[code???]

Thanks, --Andres
0
Comment
Question by:AndresHernando
1 Comment
 
LVL 85

Accepted Solution

by:
Rory Archibald earned 500 total points
ID: 37752385
You could use:
With rWholeTable
Set rTableSansTopRow = .resize(.rows.count - 1).Offset(1)
End With

Open in new window

0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Drop Down List with Unique/Distinct Values (Part II - ComboBox or ListBox and Data Validation List Bonus!) David Miller (dlmille) Intro This article focuses on delivering unique, sorted lists to list objects (e.g., ComboBox, ListBox) and Dat…
This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now