+ Reply to Thread
Results 1 to 3 of 3

VBA Macro only works when manually put the information

  1. #1
    Registered User
    Join Date
    02-17-2022
    Location
    europe
    MS-Off Ver
    2020
    Posts
    54

    VBA Macro only works when manually put the information

    So have made a data entry userform, to add the information on the sheet. the thing is when I put the data through it, the information seems to not "exist" to others macros, Unless I put the data manually.

    Please Login or Register  to view this content.

    EDIT:

    this code refer the cell with date. I cant figure out. Basically my code revolves around the date so, if i manually put the date it work, If I put through the data entry I am unable to run others macro, because it can't read the date..

    Please Login or Register  to view this content.
    Tried:

    Please Login or Register  to view this content.
    still can't fix it
    Last edited by THEVULGRIM; 06-22-2022 at 11:06 PM.

  2. #2
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often 365, but still time to time use also older versions
    Posts
    8,101

    Re: VBA Macro only works when manually put the information

    I expect that CBDA is just a textbox. So it's value is a string, not date.

    You tried to convert it to date with CDate, but then immediately converted back to string using Format.

    So may be just
    Please Login or Register  to view this content.
    will be fine.

    But as you written in a profile that your location is "Europe" your local settingd could be quite different. So make sure you enter the date in a CBDA as string following your regional settings.

    Other options could be:
    a) use a calendar control for date input
    b) use separate textboxes (or may be dropdown lists) for day, month and year and compose a date out of these elements.
    Best Regards,

    Kaper

  3. #3
    Registered User
    Join Date
    02-17-2022
    Location
    europe
    MS-Off Ver
    2020
    Posts
    54
    Quote Originally Posted by Kaper View Post

    But as you written in a profile that your location is "Europe" your local settingd could be quite different. So make sure you enter the date in a CBDA as string following your regional settings.

    Other options could be:
    a) use a calendar control for date input
    b) use separate textboxes (or may be dropdown lists) for day, month and year and compose a date out of these elements.
    It has been fixed with your help.

    Since we are talking about date and you actually talking about something I am trying to understand , If you dont mind explaing a bit more further.

    So was doing userform filter date which(dante helped me a lot) he used Cdate which is completely new to me, and most of the time the date showing on combobox is mm/dd/yyyy, sometimes it get my pc format date dd/mm/yyyy it's unstable can make some confussion to the users. Not telling your to fix just need some insight
    Last edited by THEVULGRIM; 06-23-2022 at 01:59 PM.

+ 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.OnKey only works when I manually run the macro first.
    By blu112 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-25-2021, 05:28 PM
  2. Macro errors on open but works when run manually
    By nozborne in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-26-2017, 01:15 PM
  3. [SOLVED] Data validation - works manually, but macro allows anything to be inputted. How to preven
    By thecdnmole in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 10-30-2014, 05:30 PM
  4. [SOLVED] Advanced Filter Macro does not work, running manually works fine
    By jamiemc in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-09-2013, 07:22 PM
  5. My macro only works manually
    By jimemonge in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-03-2013, 09:13 AM
  6. Replies: 1
    Last Post: 07-15-2011, 01:24 AM
  7. pivot table - works manually not by macro
    By jnewl in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-19-2006, 08:50 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