= sign error

kenpcli

Board Regular
Joined
Oct 24, 2017
Messages
129
I have this code: but when I hover over Payday it shows Payday = "="08-05 TO 08-11" and the code stops.

Payday = Application.InputBox(Prompt:="What is the Pay Period?", Type:=0)
ThisWorkbook.Sheets("HOURS BY ID").Range("G2:G1500").FormulaR1C1 = _
"=IFERROR(VLOOKUP(G2," & Payday & "$C:$Q,15,0)"
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
When building a formula, I like to do it manually first. Then, I comment it above the code line where I build the string. I then use Debug.Print to print a Run's result into VBE's Immediate window.

I don't what formula you expected from the input box or the input value. After the inputbox I would:
Code:
Debug.Print Payday

I don't know why you set R1C1 format the formula but used A1 format for its string assignment.
 
Upvote 0
I must be going about it wrong. What I am looking to do is add whatever tab name the user enters into the formula and copy down that column.
 
Upvote 0

Forum statistics

Threads
1,214,979
Messages
6,122,552
Members
449,088
Latest member
davidcom

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