Link to home
Start Free TrialLog in
Avatar of u002dag
u002dag

asked on

VBA to Clear a Region and Then Perform Vlookups

Hi,
Can you help me to add VBA code to my macro to clear a region and then add a vlookup (equation) to cells.

Attached is a sample code. It's kind of spread-out but I deleted everything but the applicable portions.  Need to Clear AU7 to AZ1000 and then have code to do what the vlookup functions do now, for each row for columns AV and AW:

=IF(ISBLANK(AA7),"",(VLOOKUP(AA7,$AE$7:$AF$107,2,FALSE)))
=IF(ISBLANK(AB7),"",(VLOOKUP(AB7,$AI$7:$AJ$13,2,FALSE)))

Thanks,
Dennis
EOS-Assistant-Experts-Exchange-t.xls
ASKER CERTIFIED SOLUTION
Avatar of StephenJR
StephenJR
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of u002dag
u002dag

ASKER

Thanks,
Do you know why I get a compile error: Syntax error when I use a similar approach for the following and how would you overcome it?:

Range("f7:f100").Formula = "=hyperlink(concatenate($al$5,am7,".pdf"),AC7"
Two things. First, you're missing a closing bracket at the end, and, second, you need to double-up quotes in VBA:

Range("f7:f100").Formula = "=hyperlink(concatenate($al$5,am7,"".pdf""),AC7)"

Open in new window