I have a set of data that changes in length. I would like to make a macro that does various things, including making the entire data set a table?
Using Selection.End(xlToRight) and xlToDown to select the data works, but when the recorded macro converts it to a table it does it only to the selected range.
Here is what the record function gives me:
Range("A1").Select
Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlDown)).Select
Application.CutCopyMode = False
ActiveSheet.ListObjects.Add(xlSrcRange, Range("$A$1:$H$26095"), , xlYes).Name _
= "Table1"
Range("Table1[#All]").Select
Is there a way to make the range dynamic based on the range selection above?
Selection
, but really you should avoid using Select – BigBenRange("$A$1:$H$26095")
toSelection
but highly recommend you read the linked thread regardless. – BigBen