+ Reply to Thread
Results 1 to 6 of 6

Find last column's address for Excel formula

  1. #1
    Forum Contributor
    Join Date
    06-17-2012
    Location
    USA
    MS-Off Ver
    Excel 2016
    Posts
    150

    Find last column's address for Excel formula

    I am trying to find the average value for a cell range extending sideways (in columns, not rows). However, I am having trouble identifying the last used column.

    This is the line of code I am using,

    Please Login or Register  to view this content.
    The CELL formula returns the last column used but enclosed in quotes, "$Z$3", and the formula would not work.

    I need the formula to appear since I've been asked to leave all formulas in the spreadsheet.

    Thank you all for your help.

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Find last column's address for Excel formula

    1.) You could use D3:IV3 and the AVERAGE function would just ignore blank or text filled cells.

    2.) If you want the formula to use the last filled cell in row 3, do you want VBA to figure the last used cell and then use that range in the formula, or do you want the formula to figure out the last used cell in the row?
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  3. #3
    Forum Contributor
    Join Date
    06-17-2012
    Location
    USA
    MS-Off Ver
    Excel 2016
    Posts
    150

    Re: Find last column's address for Excel formula

    @AlphaFrog,

    I would like scenario 2b: I want VBA to figure the last used cell and then use that range in the formula.

  4. #4
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Find last column's address for Excel formula

    Quote Originally Posted by icyrius View Post
    I would like scenario 2b: I want VBA to figure the last used cell and then use that range in the formula.
    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    06-17-2012
    Location
    USA
    MS-Off Ver
    Excel 2016
    Posts
    150

    Re: Find last column's address for Excel formula

    Excellent!!!!! I battled with this since very early this morning.

    Thanks.

  6. #6
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Find last column's address for Excel formula

    You're welcome.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Extracting the class C address from an IP address via a formula in Excel
    By floep in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-04-2023, 05:53 PM
  2. [SOLVED] HOW TO FIND THE COLUMN OR ROW NUMBER of a address stored in a cell
    By chrismonica in forum Excel General
    Replies: 3
    Last Post: 07-07-2012, 10:43 AM
  3. Find out the Row and Column address number of the searched cell (separately)
    By SunOffice in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 09-05-2011, 09:32 PM
  4. Find Dynamic hidden Column Address
    By Code Flunkie in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 02-16-2011, 02:44 PM
  5. Replies: 4
    Last Post: 07-13-2010, 09:18 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1