New Reply

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

 
Share Thread Thread Tools
Jul8-12, 11:46 PM   #1
 

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


Hello,

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;
Code:
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
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.

Thanks for any help.
 
PhysOrg.com
PhysOrg
science news on PhysOrg.com

>> 'Whodunnit' of Irish potato famine solved
>> The mammoth's lament: Study shows how cosmic impact sparked devastating climate change
>> Curiosity Mars rover drills second rock target
New Reply
Thread Tools


Similar Threads for: Simple Excel VBA problem; Applying a formula to a column if it contains a number
Thread Forum Replies
Simple column buckling problem - pl help! Engineering, Comp Sci, & Technology Homework 1
Which formula do I use. Megastats Excel Statistics homework problem Precalculus Mathematics Homework 0
Excel help with error bar formula Set Theory, Logic, Probability, Statistics 1
Help for excel formula Computing & Technology 0