mortgageman
Well-known Member
- Joined
- Jun 30, 2005
- Messages
- 2,015
I am trying to put a formula in a cell through VBA. I was trying to use what I learned here, but I keep getting an error. Any help would be appreciated. My code follows. (gen_vlookup is a udf similar to vlookup).
It is bombing on the last line.
fs = "gen_vlookup(E" & far & ",customers,2,5)+0.5*(gen_vlookup(E " & far & ",customers,2,9)"
fs = fs & "*--(gen_vlookup(E" & far & ",customers,2,10)<=A" & far & "))"
'Put formula into proper place
'Sheets("Checking").[d & far].Formula = fs
It is bombing on the last line.
fs = "gen_vlookup(E" & far & ",customers,2,5)+0.5*(gen_vlookup(E " & far & ",customers,2,9)"
fs = fs & "*--(gen_vlookup(E" & far & ",customers,2,10)<=A" & far & "))"
'Put formula into proper place
'Sheets("Checking").[d & far].Formula = fs