Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Junior Member
 
Posts: 2
Default Create Table with the range of selected cells

Hi guys!

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

Thanks for any help.
Anton.
  #2   Report Post  
Junior Member
 
Posts: 2
Default

Quote:
Originally Posted by antik888 View Post
Hi guys!

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

Thanks for any help.
Anton.

The code looks like this

Code:
ActiveSheet.ListObjects.Add(xlSrcRange, Range("A1:A2"), , xlYes).Name = _
        "Table3"
But I need to change the name of the table to current date or time. How would it look like?
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default Create Table with the range of selected cells

Like this:

ActiveSheet.ListObjects.Add(xlSrcRange, Range("A1:A2"), , xlYes).Name = _
Format(Now(),"yyy/mm/dd")
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default Create Table with the range of selected cells

Like this:

ActiveSheet.ListObjects.Add(xlSrcRange, Range("A1:A2"), , xlYes).Name = _
Format(Now(),"yyy/mm/dd")
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default Create Table with the range of selected cells

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


  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 621
Default Create Table with the range of selected cells

Have you tried the macro recorder?

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


Gord


On Sun, 29 Jan 2012 18:55:29 +0000, antik888
wrote:


Hi guys!

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

Thanks for any help.
Anton.

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default Create Table with the range of selected cells

Return the range of selected cells:

Selection.Address
  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default Create Table with the range of selected cells

Return the range of selected cells:

Selection.Address

Will return a string with the selected area address
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
create table of selected rows TBA Excel Worksheet Functions 1 April 23rd 09 02:20 AM
Create interactive pivot table chart based on item selected Sacto Harley Charts and Charting in Excel 0 October 10th 07 10:50 PM
create a thin border around the selected cells Chandra Lee New Users to Excel 1 July 24th 06 01:53 PM
Compare a selected Range with a Named range and select cells that do not exist PCLIVE Excel Programming 1 October 18th 05 07:09 PM
how do i create a formula for selected range? Yin Excel Worksheet Functions 5 September 28th 05 04:55 AM


All times are GMT +1. The time now is 12:57 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"