Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #3  
Old 01-06-2023, 04:01 PM
spillerbd spillerbd is offline After macro is created Windows 10 After macro is created Office 2021
Competent Performer
 
Join Date: Jan 2016
Posts: 130
spillerbd is on a distinguished road
Default

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
Where the variable MyTableRange is DIM as a RANGE
and MyWorkSheet is DIM as a Worksheet and defined to the desired worksheet where the table resides.
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
After macro is created 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
After macro is created 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

Other Forums: Access Forums

All times are GMT -7. The time now is 09:18 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft