CurrentRegion Selecting

  • Thread starter Thread starter He4Giv
  • Start date Start date
H

He4Giv

Hello.
I have header info in cells A4 (Quantity), B4 (Dwg. No),
C4 (Drawing Description), and D4 (Dated).
we fill in the appropiate info under these headers
starting in A5 and movig to the right.
When I wrote the code to select CurrentRegion and copy and
paste just the data to a log sheet it also grabbed the
Header info. Keep in mind that the data rows will vary, we
may have 2 rows filled in or 6 under the Header.

How do I tell VBA NOT to grab the header info, and to just
grab the data info even though the header may be part of
the CurrentRegion?

Thank you
(e-mail address removed)
 
Try this... ('Lump' is of course a variable of your choice - not an Excel keyword !!)

Set Lump = ActiveCell.CurrentRegion
Lump.Offset(1, 0).Resize(Lump.Rows.Count - 1, Lump.Columns.Count).Select
 
Try something like the following:

Dim DataRng As Range
With Range("A1").CurrentRegion
Set DataRng = Range(.Cells(2, 1), .Cells(.Cells.Count))
End With
DataRng.Select


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
 
Back
Top