+ Reply to Thread
Results 1 to 5 of 5

Find array value 2 positions away from a value in the array

  1. #1
    Forum Expert nigelog's Avatar
    Join Date
    12-14-2007
    Location
    Cork, Ireland
    MS-Off Ver
    Office 365 Windows 10
    Posts
    2,286

    Find array value 2 positions away from a value in the array

    I need to reference column numbers so columns can be hidden for print setting. The area is controlled by Option Buttons .The function below gives me 2 variables firstly the column numbers of where all option buttons are (stored in myArr) and secondly the column number of the selected option button.

    Please Login or Register  to view this content.
    Because months are both 5 as well as 4 week I need the printed area to be "Selected Radio Button Column" ie variable shpCol and the corresponding column value which is 2 values back from the shpCol value in the array +1. The Option Buttons are positioned at the right extreme of the month worth of week columns.

    I can provide workbook if requested.
    any pointers appreciated
    Attached Images Attached Images
    Last edited by nigelog; 02-14-2019 at 10:08 AM.

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Find array value 2 positions away from a value in the array

    Hi,

    Working out where the option button is positioned seems an odd way of determining which column to hide seems a somewhat long winded way of doing that. I usually use a series of Excel IF functions across all relevant columns to determine whether a column should be hidden, flag the cell accordingly, and then process that range of cells with a macro to hide or unhide the column.

    Uploading the workbook would help.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Forum Expert nigelog's Avatar
    Join Date
    12-14-2007
    Location
    Cork, Ireland
    MS-Off Ver
    Office 365 Windows 10
    Posts
    2,286

    Re: Find array value 2 positions away from a value in the array

    Hi Richard, when it was restricted in size that was the obvious choice and I could set the ranges in minutes. They want this to roll on. The most likely reference point is either the month text or the button.

  4. #4
    Forum Expert nigelog's Avatar
    Join Date
    12-14-2007
    Location
    Cork, Ireland
    MS-Off Ver
    Office 365 Windows 10
    Posts
    2,286

    Re: Find array value 2 positions away from a value in the array

    Seems to do the trick
    Please Login or Register  to view this content.

  5. #5
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Find array value 2 positions away from a value in the array

    Quote Originally Posted by nigelog View Post
    Hi Richard, when it was restricted in size that was the obvious choice and I could set the ranges in minutes. They want this to roll on. The most likely reference point is either the month text or the button.
    Without seeing the workbook I don't really understand the point you're making. However you seem to have a solution anyway.

+ 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. find array length got using split feature and valdate array elements
    By malathi1972 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-21-2018, 04:51 AM
  2. [SOLVED] Find cell in 2nd array using row and column from the first array Excel 2010 VBA
    By crywolf in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-08-2015, 02:12 PM
  3. Replies: 2
    Last Post: 12-02-2014, 05:03 AM
  4. [SOLVED] Can't figure out pasting array positions in different cells.
    By youngtusk87 in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 08-15-2012, 07:34 PM
  5. Return ALL relative positions of a value within an array
    By bekaii in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 08-19-2007, 07:37 PM
  6. using particular positions within an array
    By BorisS in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-12-2005, 10:25 AM
  7. Replies: 5
    Last Post: 04-19-2005, 05:06 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