Trevor3007
Well-known Member
- Joined
- Jan 26, 2017
- Messages
- 667
- Office Version
- 365
- Platform
- Windows
Hi,
I wanted to create a 'macro' to copy the formula =if(a6>0,a6,"") and =if(b6>0,b6,"").
using the record macro feature, produced the following:-
[/CODE]
after running the macro, & inserting data into a6 & b6, returned the following ( see fig 1)
as you can se, it should of copied the data from a6 & b6 to a200:b200
can anyone solve this for me?
I wanted to create a 'macro' to copy the formula =if(a6>0,a6,"") and =if(b6>0,b6,"").
using the record macro feature, produced the following:-
VBA Code:
ActiveCell.FormulaR1C1 = "=IF(R[-1]C>0,R[-1]C,"""""
Range("A7").Select
Selection.Copy
Range("B7").Select
ActiveSheet.Paste
Application.CutCopyMode = False
Range("A7:B7").Select
Selection.Copy
Range("A8:A200").Select
ActiveSheet.Paste
Application.CutCopyMode = False
Range("A6").Select
End Sub[CODE=vba]
after running the macro, & inserting data into a6 & b6, returned the following ( see fig 1)
as you can se, it should of copied the data from a6 & b6 to a200:b200
can anyone solve this for me?