Create Table with the range of selected cells

A

antik888

Hi guys!

I need some help with setting up vba that would insert a table wit
headers, with the name of current time and most importantly range of th
selected cells.

Thanks for any help.
Anton
 
G

Gord Dibben

Have you tried the macro recorder?

If you run into any issues, post back with the code and expected
results.


Gord
 
S

Scott Spence

Return the range of selected cells:

Selection.Address

Will return a string with the selected area address
 
A

antik888

antik888;1263271 said:
Hi guys!

I need some help with setting up vba that would insert a table wit
headers, with the name of current time and most importantly range of th
selected cells.

Thanks for any help.
Anton.


The code looks like this


Code
 
S

Scott Spence

ActiveSheet.ListObjects.Add(xlSrcRange, Range("A1:A2"), , xlYes).Name = _
Format(Now(),"yyyy/mm/dd")
 
S

Scott Spence

Like this:

ActiveSheet.ListObjects.Add(xlSrcRange, Range("A1:A2"), , xlYes).Name = _
Format(Now(),"yyy/mm/dd")
 
S

Scott Spence

Like this:

ActiveSheet.ListObjects.Add(xlSrcRange, Range("A1:A2"), , xlYes).Name = _
Format(Now(),"yyy/mm/dd")
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top