+ Reply to Thread
Results 1 to 4 of 4

Displaying the Cell column/row number that you are in.

Hybrid View

  1. #1
    Registered User
    Join Date
    02-15-2013
    Location
    Halesite, New York
    MS-Off Ver
    Excel 2010
    Posts
    39

    Displaying the Cell column/row number that you are in.

    I am building some code that will traverse through a list doing some error handling.

    When I encounter an error, I want to be able to put into a string, the actual column/row that the error exists. An example would be:

    "Invalid Name - appearing in Cell A22".

    It is at the tip of my fingers as how to do it, but I can not seem to remember.

    Can I get a hello from my distinguished colleagues to remind me of it.

    Thanks,

    Gary Harding
    Logistics Analyst
    Process Improvement
    ICON Central Laboratories

    Internal Tel: 7260 5431
    External Tel: + (1) 631-306-5431
    Mobile: + (1) 516-236-9327
    Email: Gary.Harding@iconplc.com
    Web: www.iconplc.com

  2. #2
    Registered User
    Join Date
    02-15-2013
    Location
    Halesite, New York
    MS-Off Ver
    Excel 2010
    Posts
    39

    Re: Displaying the Cell column/row number that you are in.

    Actually, I figured out the answer. Found on a file that I had in a book...

    Public Function XL_ColToLetter(ColumnNumber As Integer) As String 
        If ColumnNumber < 27 Then 
             ' Columns A-Z
            XL_ColToLetter = Chr(ColumnNumber + 64) 
        Else 
            XL_ColToLetter = Chr(Int((ColumnNumber - 1) / 26) + 64) & _ 
            Chr(((ColumnNumber - 1) Mod 26) + 65) 
        End If 
    End Function
    Thanks anyway.

    Gary
    Last edited by arlu1201; 08-30-2013 at 05:36 AM.

  3. #3
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,167

    Re: Displaying the Cell column/row number that you are in.

    Thank you for the solution.

    I have added code tags to your post. As per forum rule 3, you need to use them whenever you put any code in your post. Please add them in future. In order to put code tags, either type [CODE] before your code and [/CODE] at the end of it, OR you can highlight your code and click the # icon at the top of your post window.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

  4. #4
    Registered User
    Join Date
    02-15-2013
    Location
    Halesite, New York
    MS-Off Ver
    Excel 2010
    Posts
    39

    Re: Displaying the Cell column/row number that you are in.

    Arlu,

    My bad.... Will know for the future.

    Cheers,

    Gary

+ 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. [SOLVED] Displaying column number of 1st, 2nd .... n number of non zero cell
    By Kybynn in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-23-2012, 12:49 AM
  2. Replies: 3
    Last Post: 06-25-2010, 04:01 PM
  3. Displaying page number in a cell
    By Arnzod in forum Excel General
    Replies: 2
    Last Post: 02-19-2009, 12:26 PM
  4. [SOLVED] Displaying a number from another column
    By Natalie in forum Excel General
    Replies: 7
    Last Post: 08-06-2006, 09:15 PM
  5. displaying last number in a column
    By slurms in forum Excel - New Users/Basics
    Replies: 1
    Last Post: 02-06-2005, 08:00 PM

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