ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Macros in a template (https://www.excelbanter.com/excel-programming/279711-macros-template.html)

Michelle

Macros in a template
 
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.

Bernie Deitrick[_2_]

Macros in a template
 
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


"Michelle" wrote in message
...
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.





All times are GMT +1. The time now is 09:07 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com