+ Reply to Thread
Results 1 to 2 of 2

Looking for a script for button for text in a column on a specific date

  1. #1
    Registered User
    Join Date
    02-03-2022
    Location
    U.S.
    MS-Off Ver
    Office 2017
    Posts
    1

    Looking for a script for button for text in a column on a specific date

    This is probably pretty simple, but I'm just starting out with VBA, and struggling with how to do this.

    I have a few columns, one has dates, one has numbers, and the third I am marking with an "x". It's basically acting as a calendar. The "x" serves to drive a number of other things, such as summing the second column (example below).

    It's obviously not hard to manually add that "x", but I feel like there should be an easy way to script a button that looks to the current date (perhaps using "=TODAY()" ), and once you hit that macro button, it will do the work for you. I'm trying to use this as a template for more complex models down the road.

    Fro m the data below (I can't post screenshots yet):
    Col A is just dates, Col B is y+1 where the first row is a hardcoded 1, Col C is the hardcoded "x", and Col D is IF(Cy="x",SUM($B$3:By),Dy-1).

    This is my first post, so please let me know if you need more information.

    A B C D
    Date # Done? Cumulative
    01-01-22 1 x 1
    02-01-22 2 x 3
    03-01-22 3 x 6
    04-01-22 4 x 10
    05-01-22 5 x 15
    06-01-22 6 x 21
    07-01-22 7 x 28
    08-01-22 8 x 36
    09-01-22 9 x 45
    10-01-22 10 x 55
    11-01-22 11 x 66
    12-01-22 12 x 78
    13-01-22 13 x 91
    14-01-22 14 x 105
    15-01-22 15 x 120
    16-01-22 16 x 136
    17-01-22 17 x 153
    18-01-22 18 x 171
    19-01-22 19 x 190
    20-01-22 20 x 210
    21-01-22 21 x 231
    22-01-22 22 x 253
    23-01-22 23 x 276
    24-01-22 24 x 300
    25-01-22 25 x 325
    26-01-22 26 x 351
    27-01-22 27 x 378
    28-01-22 28 x 406
    29-01-22 29 x 435
    30-01-22 30 x 465
    31-01-22 31 x 496
    01-02-22 32 x 528
    02-02-22 33 x 561
    03-02-22 34 x 595
    04-02-22 35 595
    05-02-22 36 595
    06-02-22 37 595
    07-02-22 38 595
    08-02-22 39 595
    Last edited by TrainasaurusWrex; 02-03-2022 at 03:33 PM. Reason: Clarify title

  2. #2
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: Looking for a script for button for text in a column on a specific date

    Why do you need VBA? What's wrong with just:

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    let Source = #table({"Question","Thread", "User"},{{"Answered","Mark Solved", "Add Reputation"}}) in Source

    If I give you Power Query (Get & Transform Data) code, and you don't know what to do with it, then CLICK HERE

    Walking the tightrope between genius and eejit...

+ 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. VBA script to import text data in the first empty column of a range
    By JS85 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-25-2021, 10:55 AM
  2. [SOLVED] Help with VB script to split the text in a column into multiple columns
    By rv02 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-11-2020, 04:50 AM
  3. Replies: 5
    Last Post: 10-13-2017, 05:09 PM
  4. [SOLVED] Apply VBA Script based on Text in one column and apply a formula in another column
    By vvincent in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-07-2016, 09:19 PM
  5. Replies: 1
    Last Post: 05-13-2016, 09:03 AM
  6. [SOLVED] VBA script to filter column with multiple text strings
    By Metrazal in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-28-2014, 08:59 AM
  7. Script that edits the text printed on the button that runs the script
    By petalred in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-18-2008, 02:41 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