+ Reply to Thread
Results 1 to 9 of 9

Textboxes and vba help

  1. #1
    Registered User
    Join Date
    10-31-2016
    Location
    Cambridgebay Nunavut
    MS-Off Ver
    2010
    Posts
    14

    Textboxes and vba help

    Good afternoon,

    I have a userform where I need to record daily information. events, weather etc. I enter a date and record information through daily notes 1,2 and 3, choose the weather. When I click save, the information is stored on a spreadsheet. Each date generates on a new row. The problem I am having is in viewing the information in the userform. What I am trying is when a date or date range is entered and the view dates button is clicked, the information is displayed in the textboxes for the corresponding dates and column information line for line. Any help would be greatly appreciated.
    Attached Files Attached Files

  2. #2
    Forum Guru
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    7,749

    Re: Textboxes and vba help

    First Lets Tidy Up your Existing Code.

    You will need to renumber your controls to match the columns that they write to.

    ComboBox3 needs to be Combobox2
    TextBox2 needs to be TextBox3

    Please Login or Register  to view this content.
    Last edited by mehmetcik; 10-24-2018 at 04:53 PM.
    Please Avoid Joining My List Of Blocked Users by:

    Saying Please and Thank you.

    Making requests not demands.

    Checking back on your post. I will not edit any post after 4 days.

    Marking threads as closed once your issue is resolved. How? The tools at the top

    Any reputation (*) points appreciated. None of us gets paid here.

    If you found someone's input useful, please take a second to click the * at the bottom left to let them know

  3. #3
    Forum Guru
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    7,749

    Re: Textboxes and vba help

    Then we can look at code to make sure that textbox1 only has a valid date.

    Please Login or Register  to view this content.
    Attached Files Attached Files

  4. #4
    Forum Guru
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    7,749

    Re: Textboxes and vba help

    Finally we can Modify the Command Button 1 code to read your stored data

    Please Login or Register  to view this content.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    10-31-2016
    Location
    Cambridgebay Nunavut
    MS-Off Ver
    2010
    Posts
    14

    Re: Textboxes and vba help

    Thanks Mehmetcik. This is essentially what I was looking for it to do. Is it possible for the view dates to do a range also if applicable? ex( 10/20/2018 to 10/24/2018 to display the results in line form for each date)
    10/20/2018 give results for column C
    10/21/2018 results for column C
    10/22/2018 results for column C

  6. #6
    Forum Guru
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    7,749

    Re: Textboxes and vba help

    I have added the required functionality for you.
    Attached Files Attached Files
    Last edited by mehmetcik; 10-25-2018 at 03:27 PM.

  7. #7
    Registered User
    Join Date
    10-31-2016
    Location
    Cambridgebay Nunavut
    MS-Off Ver
    2010
    Posts
    14

    Re: Textboxes and vba help

    Looks great! I was testing it and it is not allowing me to enter a date and giving the following error : ActiveControl.Value = Format(MyDate(0), "00") & "/" & Format(MyDate(1), "00") & "/" & Format(Left(MyDate(2), 4), "0000") when I try to change anything in the start or end date.

  8. #8
    Forum Guru
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    7,749

    Re: Textboxes and vba help

    Works perfectly here.

    Did you make any changes at all?

  9. #9
    Registered User
    Join Date
    10-31-2016
    Location
    Cambridgebay Nunavut
    MS-Off Ver
    2010
    Posts
    14

    Re: Textboxes and vba help

    Hi mehmetcik, no I did not make any changes. Once I opened the most recent attached file I see a start date of 10-25-2018 and end date of 10-26-2018 but I cannot highlight or enter anything into the 'start date'. Seems locked for editing but I cannot find how. When I click in the 'end date' it immediately gives me a run-time error that script is out of range. Going into the debugger is where it has highlighted ActiveControl.Value = Format(MyDate(0), "00") & "/" & Format(MyDate(1), "00") & "/" & Format(Left(MyDate(2), 4), "0000")

+ 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. Want Average on userform textboxes to ignore blank textboxes
    By cvanderweide92177 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 10-10-2018, 12:47 PM
  2. [SOLVED] Select all text in textboxes when i click textboxes in simple way
    By HaroonSid in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-26-2017, 03:27 AM
  3. Replies: 5
    Last Post: 12-07-2016, 07:41 AM
  4. [SOLVED] For all textboxes if then
    By Crispy85 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-14-2016, 10:56 AM
  5. Populating listbox from many textboxes Abbrev. code & excluding certain textboxes
    By TheScott in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-04-2015, 03:46 PM
  6. [SOLVED] Textboxes
    By Subs in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-28-2005, 04:05 PM
  7. [SOLVED] sum of textboxes
    By Liedson31 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-03-2005, 02: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