View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
duane[_69_] duane[_69_] is offline
external usenet poster
 
Posts: 1
Default Require some codes for variable in formula


something like the following should work

GRC2 = Range("A65536").End(xlUp).Row
range(cells(1,1),cells(17,GRC2)).current region.name = "thisrange"

then refer to this range name in your vlookup

ActiveCell.formula = "=VLOOKUP(A4,thisrange,2,FALSE)

--
duan

-----------------------------------------------------------------------
duane's Profile: http://www.excelforum.com/member.php...fo&userid=1162
View this thread: http://www.excelforum.com/showthread.php?threadid=55631