![]() |
|
#2
|
|||
|
|||
|
Hi Rod
Try this Code:
Option Explicit
Sub SelectAnArea()
Dim Ws As Worksheet
Dim Lrow As Long
Set Ws = ThisWorkbook.ActiveSheet
' Find bottom row number in columns G:R
Lrow = Ws.Columns("G:R").Find(What:="*", LookIn:=xlValues, _
lookat:=xlPart, SearchOrder:=xlByRows, searchdirection:=xlPrevious, _
MatchCase:=False, searchformat:=False).Row
Ws.Range("G19:R" & Lrow).Select
End Sub
Last edited by Philb1; 03-30-2016 at 02:46 PM. Reason: End Sub was missing |
| Tags |
| macro - variable area |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
Would like a macro to copy a cell down a variable number of rows
|
Rod_Bowyer | Excel Programming | 6 | 03-25-2016 08:18 PM |
| Run Time Error '91': Object variable or With block variable not set using Catalogue Mailmerge | Berryblue | Mail Merge | 1 | 11-13-2014 05:36 PM |
Select a area in a Word Document
|
Peter Stahl | Word VBA | 2 | 08-09-2013 03:18 AM |
| Using macro to add variable number of rows to a protected word table | Julia | Word Tables | 1 | 01-09-2013 06:04 AM |
| Help with VBA macro - Variable input | sc30317 | Excel Programming | 0 | 08-31-2011 01:00 PM |