VBA - Select Cells from Pivot Table
I am quite a novice at VBA and first time posting, so please bear with me.
I am trying to copy data from a pivot table and paste value into a
separate worksheet. I need to leave the macro as flexible as possible to
cater for any potential future changes to the pivot. In essence I would
like to copy (for example) A6:E77, but this row range may need to change
(so to A6:E84, rather than A6:G77) if the underlying data changes. I can
select all the vertical non-blank cells in a discontinguous data set
using:
Range("A6", Range("A1048576").End(xlUp)).Select
However how can I then select all the cells in columns B:E that are
alongside the cells chosen in column A?
I have tried using the following code, but it seems to ignore the
End.(xlUp) command.
Range("A6:E1048576", Range("A6:E1048576").End(xlUp)).Select
Any ideas? I appreciate the help :)
No comments:
Post a Comment