Macros in a template

  • Thread starter Thread starter Michelle
  • Start date Start date
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.
 
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
 
Back
Top