Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 11-23-2015, 01:36 AM
Officer_Bierschnitt Officer_Bierschnitt is offline Filling a range variable into a formula Windows 7 64bit Filling a range variable into a formula Office 2013
Advanced Beginner
Filling a range variable into a formula
 
Join Date: Oct 2015
Posts: 87
Officer_Bierschnitt is on a distinguished road
Default Filling a range variable into a formula

Hi,

I have a problem similar to the last one (where I had to fill a row_variable into a Range_statement): Now I have to fill it into a VLOOKUP formula to write to a specific cell.


How should I do that?

Thanks a lot!

Best regards,

Officer_Bierschnitt
Reply With Quote
  #2  
Old 11-23-2015, 03:07 AM
Debaser's Avatar
Debaser Debaser is offline Filling a range variable into a formula Windows 7 64bit Filling a range variable into a formula Office 2010 32bit
Competent Performer
 
Join Date: Oct 2015
Location: UK
Posts: 221
Debaser will become famous soon enough
Default

Can you provde more information as to exactly where you need the variable to be used?
Reply With Quote
  #3  
Old 11-23-2015, 03:10 AM
Officer_Bierschnitt Officer_Bierschnitt is offline Filling a range variable into a formula Windows 7 64bit Filling a range variable into a formula Office 2013
Advanced Beginner
Filling a range variable into a formula
 
Join Date: Oct 2015
Posts: 87
Officer_Bierschnitt is on a distinguished road
Default

Hi Debaser,

well, I needed it as one parameter specifying the lookup_range (the array where to look for the value).
I solved this, however, by just giving that range a name using the Excel_name_manager and specifying that name in the formula.
The case is thus solved ;-)

Thanks anyway!

Best regards,

Officer_Bierschnitt
Reply With Quote
  #4  
Old 11-23-2015, 03:30 AM
Debaser's Avatar
Debaser Debaser is offline Filling a range variable into a formula Windows 7 64bit Filling a range variable into a formula Office 2010 32bit
Competent Performer
 
Join Date: Oct 2015
Location: UK
Posts: 221
Debaser will become famous soon enough
Default

Sample of the code you have would have been useful, but essentially you just need something like:
Code:
Activecell.Formula = "=VLOOKUP(A2,Sheet2!$A$1:$F$" & your_row_variable & ",2,FALSE)
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Object Variable or With block variable not set Raza Excel Programming 8 01-15-2015 12:19 AM
Run Time Error '91': Object variable or With block variable not set using Catalogue Mailmerge Berryblue Mail Merge 1 11-13-2014 05:36 PM
Filling a range variable into a formula Run-time error 91 object variable or with block variable not set JUST ME Word VBA 4 03-25-2014 06:56 AM
Filling a range variable into a formula object variable or with block variable not set MJP143 Excel 1 02-11-2013 05:07 AM
Filling a range variable into a formula Run-time error '91': Object variable or With block variable not set tinfanide Excel Programming 2 06-10-2012 10:17 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 02:51 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft