Consulting

Results 1 to 8 of 8

Thread: Please help

  1. #1

    Please help

    Hi guys...really need help
    Done best i can on userform
    But update button doesnt work as should and just noticed that when i enter dates on userform some save as wrong format in sheet ie i put date as 07/12/18 but in sheet it is now 12/07/18
    Attached file
    If you do fix issues please make comments explaing so i can learn
    Attached Files Attached Files

  2. #2
    Moderator VBAX Master austenr's Avatar
    Joined
    Sep 2004
    Location
    Maine
    Posts
    2,033
    Location
    are the cells you update formatted in UK or american format?
    Peace of mind is found in some of the strangest places.

  3. #3
    Formatted cells to uk dd/mm/yyyy
    On userform also enter as uk
    On purchase date entered 07/12/18
    But noticed on sheet the cell had it as 12/07/2018
    So now i have to edit all the data ive put in so far....i thought the update button was working...as had to click the vbyes a few times...but now wen i click it...the vbyesno remains and i have to close excel and restart now

  4. #4
    Moderator VBAX Sage SamT's Avatar
    Joined
    Oct 2006
    Location
    Near Columbia
    Posts
    7,814
    Location
    Query: is that December 7 or July 12?

    In Code, convert Purchase Date to MS Date format, (decimal number,) then place Date into cell.

    Purchase Date is probably a String. Microsoft application Dates are stored as decimal numbers that Excel displays as Strings. Test this by formatting the date cells as numbers. Then, does the 12/07/2018 cell display as a number?


    Note: CDate requires setting the Application's Locale setting to English(UK)
    'verbose. international
    Dim Dte as Double
    Dte = Cdate(PurchaseDate)
    Cell = Dte
    OR

    'not international
    Cell = Format(CDate(PurchaseDate), "dd/mm/yyyy")
    OR

    'International. allows other formatting of Cell
    Cell = CDate(PurchaseDate)
    BTW, IMO, the best international format is "MMM dd, yyyy" to display the month name vs month number.
    I expect the student to do their homework and find all the errrors I leeve in.


    Please take the time to read the Forum FAQ

  5. #5
    Any help with the update button
    As said when click the vbyes the box remains and i hsve to quit out of excel..mi think ive created a loop...i use and adapted code from web...my first attempt wasnt updating the data as it should
    It does now but as said im stuck with vbyesno box on screen until i exit program

  6. #6
    Moderator VBAX Master austenr's Avatar
    Joined
    Sep 2004
    Location
    Maine
    Posts
    2,033
    Location
    To escape without the task manager put in a vbCancel button in your form.
    Peace of mind is found in some of the strangest places.

  7. #7
    Will give that a gp
    Prob messed up with the code on the update button
    Did attach my file if anyone wants to look and see where i went wrong

  8. #8
    Anyone !!
    Really need to sort this asap...got tons of data to input in nxt few days

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •