Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Automatic Subtotals using VBA in Excel

Status
Not open for further replies.

66tigger40

Technical User
May 26, 2004
108
0
0
GB
Hi

Hope i can explain this correctly...

I have a spreadsheet that I run some code on to remove columns, rows etc which all works fine - the final stage is for VBA to:

Find the first blank cell in column C

Move right two and then subtotal above

And then loop again until it comes to the end of the data range

I'm stuck on how best to do this?

Any help greatly received as always

N
 



Hi,

You've deleted these rows and destroyed you table's contiguous flow...

why didn't you use the Data/Subtotal feature that is built into excel? A few keystrokes and you have a subtotaled table.

Skip,
[sub]
[glasses] [red][/red]
[tongue][/sub]
 
Hi Skip

Thank you for your response - I can't use the standard Subtotal tool as there is no change in...

For example

Row 1 Contains Company Name and Account Number

Column C then has the Amounts

But the Company Name isn't duplicated or the account number

Does that make any sense at all?

Thanks again
 



"But the Company Name isn't duplicated or the account number"

Why not? Sure seems like a simple expansion of data to solve a rather complex coding prolem.

Skip,
[sub]
[glasses] [red][/red]
[tongue][/sub]
 
Hi Skip

Your right - being newbie to VBA what would be the easiest way to get it to autofill the account code down for each subset?

Thanks for the help and advice
 



If you wanted to use the sheet as a report, and give the appearance of your currect format, consider using the features of Format/Conditional Formatting... where the FONT could be shaded the same as the cell interior if the cell & previous values are equal.

Skip,
[sub]
[glasses] [red][/red]
[tongue][/sub]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top