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 6018509
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T03:17:09+00:00 2026-05-23T03:17:09+00:00

Within Excel, I use tables to store dynamic data inside a seperate worksheet. Entering

  • 0

Within Excel, I use tables to store dynamic data inside a seperate worksheet. Entering new data works like a charm, however, I would like to be able to dynamically retrieve a single row from that table and store its data in variables. I would prefer to build a function so I could do something like this:

findFromCatsByDate(searchterm) 'returns a single row if found with mathing date.

Note that the table is dynamic and not a fixed range (so it changes vertically). I want to reuse this function with slight modification on other tables. I kind of need an example how to achieve this in VBA.

Thanks,

  • 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-23T03:17:09+00:00Added an answer on May 23, 2026 at 3:17 am

    This will return a reference the row that matches Key in a specified table

    Function GetRow(TableName As String, ColumnNum As Long, Key As Variant) As Range
        On Error Resume Next
        Set GetRow = Range(TableName) _
            .Rows(WorksheetFunction.Match(Key, Range(TableName).Columns(ColumnNum), 0))
        If Err.Number <> 0 Then
            Err.Clear
            Set GetRow = Nothing
        End If
    End Function
    

    Example use

    Sub zx()
        Dim r As Range
        Set r = GetRow("MyTable", 1, 2)
        If Not r Is Nothing Then
            r.Select
        End If
    End Sub
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How do you get spreadsheet data in Excel to recalculate itself from within VBA,
I would like to use redis to query data from commandline, scripts, web and
I need to invoke a VBA macro within an Excel workbook from a python
I know I can use the RODBC library for accessing excel (.xls) docs from
I'm new to VBA in Excel 2003. I've written a UDF that takes in
I am copying the contents of an Excel file onto the Clipboard within a
I have a powerpoint pres that grabs some data from an excel sheet when
I have some data that's currently stored in an Excel workbook. It makes sense
How do I use more than 255 characters in Excel's CONCATENATE function? I am
I'm using VBA in Excel and am trying to use the popular ShellAndWait subroutine.

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.