Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
I need some help. I'm not smart enough to figure this out, so I thought some smart people may be able to help. I need to automate a task. I need a macro that will fill in the following totals. example sheet: A 5 B 6 C 7 TOTAL D 5 E 6 F 7 TOTAL G 5 H 6 I 7 TOTAL The titles(letters) are in column "A" and values in column "B". I need a macro that will give me sub totals in column B where the A column states total. How can I do this? I have several thousand sub-totals I need and doing it manually would take weeks. thank you |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Option Explicit Sub xxx() Dim dblRowCounter As Double Dim dblSubTOTAL As Double dblRowCounter = 1 dblSubTOTAL = 0 Do Until Cells(dblRowCounter, 1) = "" dblSubTOTAL = dblSubTOTAL + Cells(dblRowCounter, 2) If Cells(dblRowCounter, 1) = "TOTAL" Then Cells(dblRowCounter, 2) = dblSubTOTAL dblSubTOTAL = 0 End If dblRowCounter = dblRowCounter + 1 Loop End Sub -- bgeier ------------------------------------------------------------------------ bgeier's Profile: http://www.excelforum.com/member.php...o&userid=12822 View this thread: http://www.excelforum.com/showthread...hreadid=543082 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
thank you, this is very helpful
|
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Uzytkownik napisal w wiadomosci oups.com... Hi, I need some help. I'm not smart enough to figure this out, so I thought some smart people may be able to help. I need to automate a task. I need a macro that will fill in the following totals. example sheet: A 5 B 6 C 7 TOTAL D 5 E 6 F 7 TOTAL G 5 H 6 I 7 TOTAL The titles(letters) are in column "A" and values in column "B". I need a macro that will give me sub totals in column B where the A column states total. How can I do this? I have several thousand sub-totals I need and doing it manually would take weeks. thank you i think you dont need macro to have that first add headers to your sheet then add one additional column next to col B - give it a header and fill down with anything ( to the end of data in col A) i assume your data will start in a2 totals will appear in 6,12,18 ... rows in b6 we should have first sum of totals - just insert there simple formula sum(b2:b4) then use autofilter on first row and select total in column A copy down formula from b6 autofilter - show all should work mcg |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I don't exactly follow what you mean on this exampe, can you give an
exampe? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Run Excel macro from Scheduled Task | Excel Worksheet Functions | |||
How to automate this task | Excel Discussion (Misc queries) | |||
VB Script to automate Excel does not run as Sheduled Task | Excel Programming | |||
can i automate task reminders in excel | Excel Discussion (Misc queries) | |||
Need a simple VBA code to automate a repetitive task. | Excel Programming |