Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 41
Default In VBA Name a Table with Relative refer.

HI,

I'm trying to name a table using vba and
using relative references.
When we create the file from the database, the table change size.
The macro I have right now do many changes in the table
then he name the table to be use later in the macro for a Pivot Table
I save this macro in Personnal Macro

My problem
The macro always name the table using the same size.
How to create a macro using relative reference.
Rules:
The table always start at cell A4
Column A always have data
The table always stop at column J
Sometimes the last cell in column J do not have data.

Here what I tried the last time
I extract only the parts to name the table.


Range("A4").Select
Range(Selection, ActiveCell.SpecialCells(xlLastCell)).Select
Application.CutCopyMode = False
ActiveWorkbook.Names.Add Name:="HvacTable", RefersToR1C1:= _
"=Sheet1!R4C1:R55C12"
ActiveCell.Select


Thanks
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
Relative Values in Pivot Table James D. Sheehan Excel Discussion (Misc queries) 2 April 26th 08 03:46 PM
How to add new field in pivot table,which doesn't refer to source Vinod[_2_] Excel Discussion (Misc queries) 1 March 25th 08 02:05 PM
refer to cell relative to range Horatio J. Bilge, Jr. Excel Discussion (Misc queries) 9 October 26th 07 03:03 PM
Relative growth in pivot table ChadBellan Excel Discussion (Misc queries) 0 May 31st 07 02:00 PM
Relative references for condtional formatting within a Pivot Table Matt X Excel Worksheet Functions 0 July 18th 06 07:42 PM


All times are GMT +1. The time now is 04:50 AM.

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

About Us

"It's about Microsoft Excel"