+ Reply to Thread
Results 1 to 3 of 3

Get result in the right column?

  1. #1
    Registered User
    Join Date
    10-30-2017
    Location
    Stockholm, Sweden
    MS-Off Ver
    Excel 2016
    Posts
    30

    Get result in the right column?

    Hi,
    Below code works fine when I add +1 for column. Without +1 result end up one column to the left.
    Cursor over LBound(Arr, 2) shows 1.
    Cursor over UBound(Arr, 2) shows 96.

    1. Can someone explain why this happens?
    2. Is "+1", the correct way to code?

    Please Login or Register  to view this content.
    Any help will be much appreciated.
    Thanks in advance!

  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: Get result in the right column?

    Hi,

    I suspect your problem is that you are not allowing for the 'base' of the array. i.e. Specify

    Please Login or Register  to view this content.
    to have arrays start with a lower bound of 1. Or Base 0 to start at zero.
    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
    Registered User
    Join Date
    10-30-2017
    Location
    Stockholm, Sweden
    MS-Off Ver
    Excel 2016
    Posts
    30

    Re: Get result in the right column?

    Good evening Mr Buttrey,
    Thank you for your quick reply.
    I was afraid of that answer because I did some research on internet before posting here and
    at site https://bettersolutions.com/vba/arra...ion-base-1.htm they say, "Never use Option Base 1".
    I'm kind of a newbie to VBA so it's not easy for me to follow all reasoning about it.
    I tried your suggestion but couldn't get it to work. I suspect it has to do with the dimming.
    Because my code is working so far (full code is not ready yet), I think I stick to it if you can't see any major flaws with the "+1".
    Thank you.

+ 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] Need result from Column A based on MAXIFS result from Column B
    By cchase22 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 09-22-2016, 06:15 PM
  2. Replies: 0
    Last Post: 03-07-2016, 08:38 PM
  3. [SOLVED] Dynamic search; using column # result to determine column used for column/row match.
    By David Brunk in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 09-18-2014, 09:57 PM
  4. Replies: 7
    Last Post: 07-25-2014, 05:08 PM
  5. [SOLVED] Search Value of column E if exist return value of column B put result in column P
    By hassan khansa in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 02-23-2013, 11:39 AM
  6. Add Date in Column A Plus Number of Days in Column B and show result in Column C
    By excelforumcrisis in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-12-2013, 02:01 PM
  7. Ping Host Name Column A IP address Result column B Response time Column c
    By NickMac in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-13-2012, 03:23 AM

Tags for this Thread

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