I am a complete beginner at macros. I frequently have to create and rename hundreds of tables and I recorded the macro to try and automate the process, but I cannot figure out how to adjust it so that it runs only on the selected cells. The name of the table is always the same as the header. Can someone please help me?
Here is my recorded Macro:
Sub Table_Creation()
'
' Table_Creation Macro
' Makes tables easier
'
' Keyboard Shortcut: Ctrl+t
'
Range("CV1:CV6").Select
Application.CutCopyMode = False
ActiveSheet.ListObjects.Add(xlSrcRange, Range("$CV$1:$CV$6"), , xlYes).Name = _
"Table432"
Range("Table432[[#All],[dayton_oh]]").Select
ActiveSheet.ListObjects("Table432").TableStyle = "TableStyleMedium1"
Range("Table432[[#Headers],[dayton_oh]]").Select
Selection.Copy
ActiveSheet.ListObjects("Table432").Name = "dayton_oh"
End Sub
A similar post offered the solution of changing the range to selection, but I guess I did it incorrectly and received an error message. Any help is appreciated!!
Thank you