IF RANGE(F8:F)= >1 then RANGE(G8:G) = D8 .... How?

TTUK

Board Regular
Joined
Apr 5, 2012
Messages
137
Hi All,

I need a forumla or script(VBA), to check to see if the number in a cell D8 (going downwards) is greater than 1, and if it is then tell G8 (going downwards) to display D8 (going downwards).

BUT, Column G cannot display any formula else my VBA macro wont work.

Hope someone can help me out on this!

Thanks, Charlie
 

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
Try

Code:
Sub test()
Dim LR As Long, i As Long
LR = Range("D" & Rows.Count).End(xlUp).Row
For i = 8 To LR
    If Range("D" & i).Value > 1 Then Range("G" & i).Value = Range("D" & i).Value
Next i
End Sub
 
Upvote 0
Hi Charlie

How about this:

Code:
Sub TTUK()
Dim rng As Range

Set rng = Range("D8:D" & Cells(Rows.Count, "D").End(xlUp).Row)

With rng.Offset(, 3)
    .FormulaR1C1 = _
        "=IF(RC[-3]>1,RC[-3],"""")"
    .Value = .Value
End With
End Sub

The formulas are inserted as an intermediate step and are then removed with just the values being left.
 
Upvote 0

Forum statistics

Threads
1,203,529
Messages
6,055,933
Members
444,836
Latest member
nVaNL

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top