Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
using Subtotals in XL-VBA
I have created a Macro which picks up data from two seperate Access databases
and populates the XL sheets. One of the function of this macro is to pull data from an Access database and apply subtotals onto to the sheet. Now this works perfectly fine till the time the information pulled is not blank. Now suppose the data pulled has zero records, the Macro stops since there are nothing to be subtotalled. How do I fix this. ? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
using Subtotals in XL-VBA
Check to see what's in the range before you try the subtotal code.
dim myRng as range with worksheets("sheet1") set myrng = .range("a1:e" & .cells(.rows.count,"A").end(xlup).row) end with if myrng.rows.count = 1 then msgbox "just headers--no data" else 'keep going with your code end if I used column A to find out the last used row in that range. Venky wrote: I have created a Macro which picks up data from two seperate Access databases and populates the XL sheets. One of the function of this macro is to pull data from an Access database and apply subtotals onto to the sheet. Now this works perfectly fine till the time the information pulled is not blank. Now suppose the data pulled has zero records, the Macro stops since there are nothing to be subtotalled. How do I fix this. ? -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Subtotals problem: Excel 2003 (not, AFAIK, the nested subtotals bug) | Excel Discussion (Misc queries) | |||
Original subtotals should not be within nested subtotals in excel | Excel Worksheet Functions | |||
How do I copy an outline w/ subtotals & paste just the subtotals | Excel Discussion (Misc queries) | |||
Problem with nested subtotals, placing secondary subtotals BELOW . | Excel Discussion (Misc queries) | |||
why are nested subtotals coming out below outer subtotals? | Excel Worksheet Functions |