Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3393052
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T04:00:17+00:00 2026-05-18T04:00:17+00:00

I have an Excel VBA sub that (among other things) pastes a lookup formula

  • 0

I have an Excel VBA sub that (among other things) pastes a lookup formula into some cells. The lookup formula is presently of the form

LOOKUP(RC5,lookup.xlsx!Item,lookup.xlsx!R2C:R559C)

but the size of the lookup table will change. Is there a good way to find the size of the lookup table, that is, the last row?

In a pinch I suppose I could open the lookup file (what’s the command for that?) and do

Windows("lookup.xlsx").Activate
last = Range("a65536").End(xlUp).Row    
Windows("whatever.xlsx").Activate

but I’m not sure if there’s a better way.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T04:00:18+00:00Added an answer on May 18, 2026 at 4:00 am

    Finding the last used cell has a bad reputation in Excel AFAIK. See for example this , although a bit outdated. If you can, just be sure to insert an EOF value in the last used row and scan for it.

    Edit

    Remember:

    • A null value (or spaces) may serve well as an EOF flag. Be sure to be consistent.
    • You may always include full columns in the lookup range and excel will take care of the end (if there are no more used cells under your range. Like in =LOOKUP(A1,C:C,D:D)
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a VBA script that inserts long strings into Excel cells. In some
I have a VB6/VBA application that hooks into Excel and loads a workbook. It
I'm using Excel VBA and have a worksheet_change event like so: Private Sub Worksheet_Change(ByVal
I have writen some code in VBA (Excel) with error handling labels. It worked
I have written a VBA macro in an excel spreadsheet that opens all workbooks
I need to use VBA to filter some information in excel. As I have
I have a VBA macro that copies rows from one worksheet into another based
I am have the following code for excel vba that will email a range
I have an excel vba problem that I am trying to solve and after
I have an excel form that I created in combination with VBA. In the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.