Macros in a template

M

Michelle

Bit hard to explain - but here I go. I have to set up a
template in excel which then exports data from Lotus Notes
and puts data in excel.

I want to have a button that managers can push to run a
macro that sorts the data. My problem how do I select a
range when i do not know the number of rows the
spreadsheet will be as it will differ each time depending
on records selected to export.

There is within the report excel template in the Name Box
a reference to "Datarows" which shows up under the data
and advises the number of rows of data ie records. I am
unsure if I can or how to make this my end reference.
This is way over my head - any help would be appreciated.
 
B

Bernie Deitrick

Michelle,

When sorting, simply using

Range("A1").CurrentRegion.Sort ......

- changing the A1 to a cell that is definitely in the sort range -
will do it.

HTH,
Bernie
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top