Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

run calculation loop

Status
Not open for further replies.

ali32j

Technical User
Apr 23, 2007
97
GB
Hi all

I m looking to run a simple calculation on command click, using a loop, i want to check cell H2 and G2 if value is present, subtract G2 from H2 and place result in cell M2, and then loop until H2 and G2 are empty

Is this possible? can anyone help? sorry i m struggling with syntax in excel

Ali
 
What are you aiming for? It sounds like you are only after modulo, like =MOD(H2,G2)

Cheers, Glenn.

Beauty is in the eye of the beerholder.
 
I have a sheet which i would like to avoid having to copy and paste the formula all the way down the column (has 9000 lines) so i would like the command button to do it for me with out going past the last value

Formula i have in cell M2 is = G2-H2, so i want the command button click to put that formula in every cell where the is a value in either G or H
 



hi,

...i would like to avoid having to copy and paste the formula all the way down the column

You realize that you can autofill a formula, value or series in a range in one operation.

Copy your formula.

Select the target range

Edit > Paste

Skip,
[glasses]Don't let the Diatribe...
talk you to death![tongue]

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
What's in cols I,J,K, and L? If there's data in G, H and those columns all the way down to the end of the data then enter your formula in M2 and double-click the fill-handle ( bottom right corner of the cell ).

Cheers, Glenn.

Beauty is in the eye of the beerholder.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top