cancel
Showing results for 
Search instead for 
Did you mean: 

Referencing Input Schedule cells from a VBA macro

Former Member
0 Kudos

Dear All,

We are trying to do some calculations in this way:

1. I get the information from the DB by a input schedule (EVDRE)

2. On the data retieved I have to make some modification

3. I would like to use VBA macro to do this changes

question :

If the colum H24 contains the data I would like to multiply by 30 and save in a macro variable TOTAL

how should the VBA code look like ?

Thanks in advance for your help

FedeX

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi

I would like to multiply the value of a cell by *30

I would like to control the referencing to the cells by using i and j

something like this

n= 3

m = 5

i from 1 to n

j from 1 to m

cell(i,j) = cell(i,j)*30

Thanks

FedeX

Former Member
0 Kudos

Thank for answer and hints,

I will open regarding the same task in a logic script.

one additional question regarding this scenario.. if I am navigationg the input schedule with to variable i and j

how should be the instruction to replace the

Range("H24") ?

Thanks

FedeX

Former Member
0 Kudos

What exactly do you want to achieve?

You navigate all cells in i to j, and multiply each value with 30, and the sum is stored in total? Or do you want each value to be stored seperatly in a seperate variable?

With kind regards,

Tim Vierhout

Former Member
0 Kudos

Hi FedeX

Your VBA macro should look like this:

sub calculation()

dim total as integer

total = Range("H24").value * 30

end sub

However, I would advise to create the calculations inside either script logic or use normal excel calculations, have you considered those first?

With kind regards,

Tim Vierhout

Former Member
0 Kudos

Hi Fedex,

Have you thought about using script logic for the above scenario?

Cheers,

Karthik AJ