crag8119

New Member
Joined
Mar 25, 2014
Messages
38
Hi,

I want my macro to populate column 'N30:N30000' with my formula.

However, for some reason it won't compile the macro due to ' Syntax error'. Any ideas how to resolve this:

Sub FillDown() Dim strFormulas(1) As Variant


With ThisWorkbook.Sheets("Sheet1")
strFormulas(1) = "=IF(ISNUMBER(MATCH("*|"&LEFT(D5,8),$E$1:$E$100,0)),LEFT(D5,8),"No match")"


.Range("N30").Formula = strFormulas
.Range("N30:N30000").FillDown
End With


End Sub
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
Hello Crag8119,

Try it slightly amended as follows:-

Code:
Sub FillDown()

With ThisWorkbook.Sheets("Sheet1")
       .Range("N30").Formula = "=IF(ISNUMBER(MATCH([COLOR=#ff0000]""*|""[/COLOR]&LEFT(D5,8),$E$1:$E$100,0)),LEFT(D5,8),[COLOR=#ff0000]""No match""[/COLOR])"
       .Range("N30:N30000").FillDown
End With

End Sub

or

Code:
Sub Test()

Sheet1.Range("N30:N30000").Formula = "=IF(ISNUMBER(MATCH(""*|""&LEFT(D5,8),$E$1:$E$100,0)),LEFT(D5,8),""No match"")"

End Sub

I hope that this helps.

Cheerio,
vcoolio.
 
Upvote 0
Hello Crag8119,

Try it slightly amended as follows:-

Code:
Sub FillDown()

With ThisWorkbook.Sheets("Sheet1")
       .Range("N30").Formula = "=IF(ISNUMBER(MATCH([COLOR=#ff0000]""*|""[/COLOR]&LEFT(D5,8),$E$1:$E$100,0)),LEFT(D5,8),[COLOR=#ff0000]""No match""[/COLOR])"
       .Range("N30:N30000").FillDown
End With

End Sub

or

Code:
Sub Test()

Sheet1.Range("N30:N30000").Formula = "=IF(ISNUMBER(MATCH(""*|""&LEFT(D5,8),$E$1:$E$100,0)),LEFT(D5,8),""No match"")"

End Sub

I hope that this helps.

Cheerio,
vcoolio.

Brilliant thank you
 
Upvote 0
You're welcome Crag. I'm glad to have been able to help.

Cheerio,
vcoolio.
 
Upvote 0

Forum statistics

Threads
1,215,054
Messages
6,122,895
Members
449,097
Latest member
dbomb1414

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