Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
hi,
I would like to know how to define a macro that checks column A, (1) if non-empty, adds all the values present in it (2) if empty, jumps to column B and adds the values present there. I tried it out but with no success. Can somebody help please? Its pretty urgent. Thanking you in advance. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sub Addcolumns()
total = WorksheetFunction.Sum(Columns("A")) If total = 0 Then total = WorksheetFunction.Sum(Columns("B")) End If End Sub "BAS" wrote: hi, I would like to know how to define a macro that checks column A, (1) if non-empty, adds all the values present in it (2) if empty, jumps to column B and adds the values present there. I tried it out but with no success. Can somebody help please? Its pretty urgent. Thanking you in advance. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Macros in Personal.xls that would create two toolbars and buttonswith assigned macros | Excel Programming | |||
choose default macros Not Enabled / Macros Enable Setting | Excel Programming | |||
weird saving of a document with macros resulting with macros being transfered to the copy | Excel Programming | |||
Macros inside macros, and pasting into macro code. | Excel Programming | |||
convert lotus 123w macros to excel macros | Excel Programming |