So I have been working on a project that utilizes a pivtot table with monthly data in it to do and display all sorts of other things... Those macros, for the most part, function ok.

I am at the stage where I'm now trying to set up a system so that come the beginning of the new month, the updated data can be imported from the new spreadsheet painlessly.

I have a macro that clears the old data and pastes the new stuff in its place. Now a problem here is that the number of rows will change month to month (columns will be 100% identical) and I need to adjust the pivot table source range accordingly.

I can count up to the last row of data and get an integer telling me what row is the last one, but I don't know how to pass that to change the data range of the pivot table.

Any ideas on a method?