Mattie Owens
asked on
Copying formula down column
I am trying to copy a formula in a range of cells. I placed the worksheet activate and nothing is happening. What am I missing.
Private Sub Worksheet_Activate()
Range("B6").Select
Range("B10:B1000").Formula = "=IFERROR(MID(C17,FIND(" * ",SUBSTITUTE(C17," \ "," * ",LEN(C17)-LEN(SUBSTITUTE( C17," \ ",""))))+1,LEN(C17)),"")"
Range("D10:D1000").Formula = "=LEFT(B10,10)"
End Sub
Private Sub Worksheet_Activate()
Range("B6").Select
Range("B10:B1000").Formula
Range("D10:D1000").Formula
End Sub
Also, this will only work if you are on another sheet and you return to this sheet.
This question needs an answer!
Become an EE member today
7 DAY FREE TRIALMembers can start a 7-Day Free trial then enjoy unlimited access to the platform.
View membership options
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
So if you want to run this code when say Sheet2 gets activated, right click the Sheet2 Tab --> View Code --> Place the code into the opened code window --> Save your workbook as Macro Enabled Workbook.
Also, the line which places the formula should be like this...
Open in new window