frank850102
New Member
- Joined
- Jan 26, 2010
- Messages
- 7
Hi there
I have a table that requires inserting rows and deleting rows frequently, and extracting data from this table using Vlookup function.
In order to create this table as a dynamic table, I used "name manager" function. In the name manager, I typed the name of the table "Table 1", and the table range using "offset" function as OFFSET(Sheet1!$A$1,,,COUNT(Sheet1!$E:$E),10).
Now I want to create a macro that is able to adjust the print area of the spreadhseet such that it always prints only the "Table 1", not everywhere else. I don't want to use cell reference to define "Table 1" such as printarea. = "A1:J85", I would like the reference to be dynamic, such as the "OFFSET" function in the "Name Manager". Therefore, when I insert rows, it can still pick up the right print area for "Table 1".
I am not sure how to achieve this in VBA.
Please help.
Thank you very much.
I have a table that requires inserting rows and deleting rows frequently, and extracting data from this table using Vlookup function.
In order to create this table as a dynamic table, I used "name manager" function. In the name manager, I typed the name of the table "Table 1", and the table range using "offset" function as OFFSET(Sheet1!$A$1,,,COUNT(Sheet1!$E:$E),10).
Now I want to create a macro that is able to adjust the print area of the spreadhseet such that it always prints only the "Table 1", not everywhere else. I don't want to use cell reference to define "Table 1" such as printarea. = "A1:J85", I would like the reference to be dynamic, such as the "OFFSET" function in the "Name Manager". Therefore, when I insert rows, it can still pick up the right print area for "Table 1".
I am not sure how to achieve this in VBA.
Please help.
Thank you very much.