Hello,(adsbygoogle = window.adsbygoogle || []).push({});

I have a relatively simple problem, You have two columns filled with numbers. I want my macro to go through and check the columns or one of the colums to see if it has a number in it, then operate on those numbers and display an output in a third column .

I tried this;

I know I can simply drag a formula but I want to automate this, and I also want to be able to reuse the same thing later.Code (Text):

Sub Total()

'

' Total Macro

'

'

If IsNumeric(Range("H8", Range("H8").End(xlDown))) Then

Dim CopyRange As Range

Set CopyRange = Range("J8", Range("J8").End(xlDown))

Sheets("Sheet1").Range(CopyRange.Address).FormulaR1C1 = "=RC[-1]*RC[-2]"

End If

End Sub

Thanks for any help.

**Physics Forums - The Fusion of Science and Community**

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# Simple Excel VBA problem; Applying a formula to a column if it contains a number

Can you offer guidance or do you also need help?

Draft saved
Draft deleted

Loading...

Similar Threads - Simple Excel problem | Date |
---|---|

LaTeX \vec command | Jan 31, 2018 |

Simple MATLAB loop | Oct 30, 2015 |

Coding up a simple geometric algebra in MATLAB | Oct 12, 2015 |

Simple MS Excel Graph question | Aug 7, 2012 |

Simple MATLAB to Excel Question | Jun 19, 2012 |

**Physics Forums - The Fusion of Science and Community**