Macro Ranges

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

What statement can be wriiten in Macro
that I can say range1 = range2 divided by range3
if range2 >1 and range 3 is >1
 
Try this example.

Sub If_Test()

Dim rng1 As Range
Dim rng2 As Range
Dim rng3 As Range

Set rng1 = Sheets("Sheet1").Range("A1")
Set rng2 = Sheets("Sheet1").Range("B1")
Set rng3 = Sheets("Sheet1").Range("C1")

If rng2 > 1 And rng3 > 1 Then
rng1 = rng2 / rng3
End If

End Sub

Regards,

OssieMac
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top