Macro Question, Importing data from a report & end value changes every time

SatiricBecks

New Member
Joined
Oct 9, 2013
Messages
8
Hi all thanks for any help offered.

I am trying to create a macro for a report that im doing.

at one point in the report i have to put the range field into a pivottable and pivot chart wizard.

which comes as 'rawdata'!$A$1@$I$1085 the end 4 digits (1085) will change reflecting the last row of data imported from the report, how would i get that to reflect in the macro?

Thanks again.
 
Do you need a macro for this? How about changing the input range (to the last row in the sheet). This way you will not have to change your input range again. Filter out any blanks with filters in the pivot...
 
Upvote 0
You can use something like:

Code:
Activeworkbook.pivotcaches.create(xldatabase, "'rawdata'!" & sheets("rawdata").range("A1").currentregion.address(referencestyle:=xlR1C1))
 
Upvote 0
Do you need a macro for this? How about changing the input range (to the last row in the sheet). This way you will not have to change your input range again. Filter out any blanks with filters in the pivot...

It is only one part of a long process, to change the input range, what would i have to do?

currently a box comes up and i type 'rawdata'!$A$1:$I$1085 i normally only change the 1085 to correspond with the last row of the file, is there something else i could put in instead of the 1085?

thanks again
 
Upvote 0
It is only one part of a long process, to change the input range, what would i have to do?

currently a box comes up and i type 'rawdata'!$A$1:$I$1085 i normally only change the 1085 to correspond with the last row of the file, is there something else i could put in instead of the 1085?

thanks again
 
Upvote 0
If you just want to use all the data on rawdata then the code I posted should remove the need for any user input at all.
 
Upvote 0
Change 1085 to the last row in the sheet. I.e. 1.048.576 if you are using excel 2010.


It is only one part of a long process, to change the input range, what would i have to do?

currently a box comes up and i type 'rawdata'!$A$1:$I$1085 i normally only change the 1085 to correspond with the last row of the file, is there something else i could put in instead of the 1085?

thanks again
 
Upvote 0

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top