Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default macro for excel, automate task

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default macro for excel, automate task


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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default macro for excel, automate task

thank you, this is very helpful

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 33
Default macro for excel, automate task


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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default macro for excel, automate task

I don't exactly follow what you mean on this exampe, can you give an
exampe?



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Run Excel macro from Scheduled Task coolthinking Excel Worksheet Functions 4 July 13th 09 03:35 PM
How to automate this task [email protected] Excel Discussion (Misc queries) 2 July 14th 06 12:38 AM
VB Script to automate Excel does not run as Sheduled Task dan artuso Excel Programming 2 May 12th 06 08:41 PM
can i automate task reminders in excel shootist55 Excel Discussion (Misc queries) 0 May 3rd 05 12:37 AM
Need a simple VBA code to automate a repetitive task. madhu Excel Programming 2 January 21st 05 10:55 AM


All times are GMT +1. The time now is 06:30 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"