+ Reply to Thread
Results 1 to 3 of 3

How to identify a column

  1. #1
    Forum Contributor
    Join Date
    03-30-2010
    Location
    Manchester England
    MS-Off Ver
    Excel 2010
    Posts
    992

    How to identify a column

    I am using the following procedure to identify a range and send it another procedure, MakeMatrix, which sets out a matrix of borders to its cells
    Please Login or Register  to view this content.
    My problem comes to light when I discover Range("MatrixRange2") has no borders or lines. The reason turns out to be that lrow has a value of 1.
    This is odd in that the value of StartPlace is as expected and the next column on (StartPlace+1), at present, has the last occupied row of 148.
    What I want to do is to identify which column my code is actually looking at. I thought of using WorkbookFunction.Address but this is not possible. I am stuck and would welcome some help.
    John

  2. #2
    Valued Forum Contributor
    Join Date
    01-16-2012
    Location
    England
    MS-Off Ver
    MS 365
    Posts
    1,397

    Re: How to identify a column

    Not clear what YearLen represents?, or whether StartPLace is a "fixed" cell or column? So made this to generate random ranges.
    Click button and Messagebox tells you which columns are covered in the Ranges. You need only one message because you set both your ranges to start and end with the same columns, only differing in the row at which they start.
    Please Login or Register  to view this content.
    NOTE: Just realised attached sample hasn't offset the End Col, so you need to change the Set Matrix rows on it from ".Cells(1, EndCol)" to ".Cells(1, EndCol - 2)"

    Hope this helps

    Ochimus
    Attached Files Attached Files
    Last edited by Ochimus; 12-03-2020 at 02:17 PM.

  3. #3
    Forum Contributor
    Join Date
    03-30-2010
    Location
    Manchester England
    MS-Off Ver
    Excel 2010
    Posts
    992

    Re: How to identify a column

    Ochimus
    Many thanks for your interest. I shall not be back in operation till Monday, when I shall be using your input. I will let you know how I get on.
    Something very odd is going on. If step through my code, all works, if I run it lrow takes a value 0f 1 and there is no matrix.
    John

+ 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] UNSOLVED - Identify highlighted cells in column, copy cell value to column B of active row
    By Armitage2k in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-16-2014, 04:42 AM
  2. column comparison, trying to identify identify identical columns.
    By Jowel in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 06-24-2014, 04:12 AM
  3. Replies: 3
    Last Post: 06-22-2014, 08:55 AM
  4. Replies: 2
    Last Post: 02-28-2014, 06:42 PM
  5. Replies: 4
    Last Post: 08-29-2013, 04:27 PM
  6. [SOLVED] Identify the last filled row in Column A and then drag formula in Column B till the same
    By bonny24tycoon in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-13-2012, 10:50 AM
  7. Replies: 4
    Last Post: 04-09-2011, 02:51 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