#1
|
|||
|
|||
After macro is created
So I pull data from a data base this information may change My issue is control a then creating a table may change from report to report so when I first do the macro it may have only 100 rows and when I run the macro for another report it may have 150 rows. When running it it will only catch when I did the first report. Is there a way to automatically catch all rows regardless if it has 100 rows or 500 rows of data? |
#2
|
||||
|
||||
Hi
make your range an Excel Table and correct your Macro accordingly (BTW there is a VBA dedicated subforum on this forum)
__________________
Did you know you can thank someone who helped you? Click on the tiny scale in the right upper hand corner of your helper's post |
#3
|
|||
|
|||
You can also use CurrentRegion, which is like pressing CTRL+* in a range, and may be better depending on the source of the data/workbook. TABLES are generally better.
Code:
MyTableasRange = MyWorksheet.Range("A1").CurrentRegion and MyWorkSheet is DIM as a Worksheet and defined to the desired worksheet where the table resides. |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Can a Macro be run such that by which an Excel table (one is created by ctrl+t) be “Pasted Link” to | soroush.kalantari | Word VBA | 3 | 09-21-2021 11:48 PM |
How to remove space between header and first bullet in Outlook email created by Excel macro | kevinbradley57 | Excel Programming | 1 | 03-27-2019 08:39 PM |
Forms created in Word | Johnmcl | Word | 7 | 11-25-2015 07:01 PM |
Pre Created Form help | SRKS72 | Word | 4 | 08-30-2014 03:57 PM |
mtg/appt. created - enter into SQL db also | manared | Outlook | 0 | 02-07-2011 11:04 AM |