+ Reply to Thread
Results 1 to 7 of 7

How to write in vba "Between" to specificy values

  1. #1
    Registered User
    Join Date
    11-07-2023
    Location
    Connecticut, USA
    MS-Off Ver
    Microsoft 365 and Office
    Posts
    49

    How to write in vba "Between" to specificy values

    HI- In the attached test file (this is only part of a huge report but I am stuck in figuring out this step). How I write in VBA "Between" to look in this example at column A for anything that starts from 28 to 32.99 and then when found between those numbers to write on column E "28.00 to 32.99".

    I try to wrote it like this but I am not sure what I am doing wrong?

    Please Login or Register  to view this content.
    Thank you.
    Attached Files Attached Files
    Last edited by alansidman; 05-14-2024 at 08:21 PM.

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,813

    Re: How to write in vba "Between" to specificy values

    Try (untested):

    Please Login or Register  to view this content.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Registered User
    Join Date
    11-07-2023
    Location
    Connecticut, USA
    MS-Off Ver
    Microsoft 365 and Office
    Posts
    49

    Re: How to write in vba "Between" to specificy values

    @TMS when I do that I get the Compile error: Expected: expression.

  4. #4
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,813

    Re: How to write in vba "Between" to specificy values

    Not a problem with the line of code.

    Please Login or Register  to view this content.

  5. #5
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2406 Win 11 Home 64 Bit
    Posts
    23,983

    Re: How to write in vba "Between" to specificy values

    @ladyj07

    Administrative Note:

    We would very much like to help you with your query, however your post does not comply with our guidelines

    Please take a moment to review how to add code tags. Posting code between [code]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/code] tags makes your code much easier to read and copy for testing, and it also maintains VBA formatting.

    Please see Forum Guideline #2 about code tags and adjust accordingly. Click on Edit to open your post, then highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here.

    I have added the code tags for you today. Please take a few minutes to re-read our guidelines and rules that you agreed to when you joined and comply in the future.
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  6. #6
    Registered User
    Join Date
    11-07-2023
    Location
    Connecticut, USA
    MS-Off Ver
    Microsoft 365 and Office
    Posts
    49

    Re: How to write in vba "Between" to specificy values

    @tms Thank you very much for your help.

  7. #7
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,813

    Re: How to write in vba "Between" to specificy values

    You're welcome. Thanks for the rep.

+ 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] Brief formula to convert time values to "shift1", "shift2", "shift3".
    By darekpawel in forum Excel Formulas & Functions
    Replies: 20
    Last Post: 04-11-2019, 07:05 AM
  2. [SOLVED] Identify specific numeric values in a cell such as "1" without counting "11" as two "1"s
    By MHanna39 in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 04-03-2019, 01:35 PM
  3. "LOOP?" to write values in user from to work sheet.
    By Adventure_Harry in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-12-2014, 10:10 AM
  4. [SOLVED] Formula needed to display "Pass" or "Fail" if a column contains any values other than "yes
    By andreindy in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 03-26-2013, 05:49 PM
  5. Replies: 0
    Last Post: 01-09-2013, 06:52 PM
  6. Replies: 3
    Last Post: 02-16-2011, 02:55 PM
  7. How to write cell address of the match in this , =IF(COUNTIF(A:A,B1)>0,"x","")
    By sureng19 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-24-2010, 08:03 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