Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
hi there,
i want to make a macro that takes the sum of cell (B1) for example and multiplies it by (A1), my problem is that i also want to apply the macro on other cells (like (B2)) so i want to have 2 active cells (one for taking sum of cells & the other to calculate the multiplication) - is it possible? e.g. A B C 1 2+3*5 MACRO OF SUM A1*B1 2 7+3*1 MACRO OF SUM A2*B2 3 6+5*2 MACRO OF SUM A3*B3 is it possible? thank u |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
This is easily done but please re-state your requirements.
-- Don Guillett SalesAid Software "dodo" wrote in message ... hi there, i want to make a macro that takes the sum of cell (B1) for example and multiplies it by (A1), my problem is that i also want to apply the macro on other cells (like (B2)) so i want to have 2 active cells (one for taking sum of cells & the other to calculate the multiplication) - is it possible? e.g. A B C 1 2+3*5 MACRO OF SUM A1*B1 2 7+3*1 MACRO OF SUM A2*B2 3 6+5*2 MACRO OF SUM A3*B3 is it possible? thank u |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Why do you need a macro? Just type a formula into C column cells:
=A1*B1 |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
hi all,
the reason that c1<a1*b1 is because a1 contains charactes that must be evaluated first befroe getting its sum. (eg. 25+3*1) u see this * do not let excel evalutes it automaticly, but using evalute function in vba let this possible. anyway i have figured it out as follows: Dim Rng1 As Range, Rng2 As Range Set Rng1 = ActiveCell Set Rng2 = ActiveCell.Offset(0, 1) Rng2.Value = Evaluate(Rng1.Value) many thanks |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
hi all,
the reason that c1<a1*b1 is because a1 contains characters that must be evaluated first before getting its sum. (eg. 25+3*1) u see this * do not let excel evaluates it automatically, but using evaluate function in vba let this possible. anyway I have figured it out as follows: Dim Rang As Range, Rang As Range Set Rang = Active Set Rang = Active.Offset(0, 1) Rang.Value = Evaluate(Rang.Value) many thanks |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Row select mode to highlight active row of active cell | Excel Discussion (Misc queries) | |||
set the background color of the current cell(active cell) | New Users to Excel | |||
referring to formula in a non active cell from active cell | Excel Discussion (Misc queries) | |||
HOW TO COPY 480 ACTIVE E-MAIL ADDRESSES CLM "G" ON AN ACTIVE EXCE. | Excel Discussion (Misc queries) | |||
Select First Active Cell if the cell is in a pivot table | Excel Programming |