+ Reply to Thread
Results 1 to 7 of 7

Using the & correctly in formula

  1. #1
    Registered User
    Join Date
    11-17-2017
    Location
    Australia
    MS-Off Ver
    Excel 2016
    Posts
    60

    Using the & correctly in formula

    Hi All,

    I have the below code that works (FindMax), but thought I would try and alter it by replacing the “B20:B” part with FR. I’m not having any luck, can someone point me in the right direction please.


    This works

    Please Login or Register  to view this content.

    This does not – the Range("e6").Formula = "=Max(" & FR & LR & ")” part is wrong, it is missing the colon: and don’t know how to make it work.


    Please Login or Register  to view this content.

    Thanks
    Nat

  2. #2
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    7,468

    Re: Using the & correctly in formula

    If FR is always static as B9, then why replace it in the formula at all?

    But if you really want to then you could use this:
    Please Login or Register  to view this content.
    BSB

  3. #3
    Valued Forum Contributor
    Join Date
    06-02-2012
    Location
    London, England
    MS-Off Ver
    365
    Posts
    397

    Re: Using the & correctly in formula

    Hi Nat,

    Note in your original code you're declaring FR as Long but then setting it as a range. This is confusing matters slightly.

    BSB beat me to a solution but mine wasn't much different.

    Beth.

  4. #4
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,591

    Re: Using the & correctly in formula

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    11-17-2017
    Location
    Australia
    MS-Off Ver
    Excel 2016
    Posts
    60

    Re: Using the & correctly in formula

    Thank you all,

    BSB,
    you are correct, why replace it - I just thought I would try and make it easier, but not really so.

    Beth, Y
    es, I found that out - that Long was not correct.

    Jindon
    Not sure how it works with the resize, but it does

    Again, thank you all for your help

    Cheers
    Nat

  6. #6
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    7,468

    Re: Using the & correctly in formula

    Glad we could help

    BSB

  7. #7
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,591

    Re: Using the & correctly in formula

    Quote Originally Posted by NatalieW12 View Post
    Jindon
    Not sure how it works with the resize, but it does
    It works based on the first cell, so doesn't need to know the column as long as LR is given.

+ 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. Application.EnableEvents not workng correctly code too long? not written correctly?
    By Carissaleigh2010 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-22-2019, 01:13 PM
  2. [SOLVED] substitute formula not working correctly on a specific date formula
    By jrtaylor in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 01-27-2019, 11:54 AM
  3. If then formula not working correctly
    By chappie97 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 12-23-2013, 01:22 AM
  4. [SOLVED] IF - Formula Not Functioning Correctly
    By Inez15 in forum Excel General
    Replies: 2
    Last Post: 11-12-2012, 06:51 PM
  5. entering in formula correctly...
    By 5.0stang in forum Excel General
    Replies: 4
    Last Post: 05-09-2008, 04:18 PM
  6. If formula- Am I explaining this correctly?
    By bacarat in forum Excel General
    Replies: 3
    Last Post: 04-12-2007, 08:53 AM
  7. Dragging a formula correctly?
    By J.D. Webster in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-07-2006, 10:25 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