+ Reply to Thread
Results 1 to 3 of 3

Userform textbox date sorting problem in main sheet

  1. #1
    Registered User
    Join Date
    08-22-2012
    Location
    Townsville
    MS-Off Ver
    Excel 2010
    Posts
    38

    Userform textbox date sorting problem in main sheet

    Hi,

    I've got a userform that has a textbox that gets a date from the user. Then I use the following to store it in the location I want:

    Please Login or Register  to view this content.
    Then the code goes on to do other stuff and finishes with sorting the date in ascending order. However it doesn't sort the dates that are put in from the textbox and I can't even change the cell format to go to a general number. The only way I can do it is if I double click in the cell with the date and then press enter.. Driving me crazy..

    Anyone got any suggestions?

    Cheers,
    Amoxia

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Userform textbox date sorting problem in main sheet

    Try this to convert the textbox's text to a serial date.

    ActiveCell.Value = CDate(txtStartDate.Value)
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  3. #3
    Registered User
    Join Date
    08-22-2012
    Location
    Townsville
    MS-Off Ver
    Excel 2010
    Posts
    38

    Re: Userform textbox date sorting problem in main sheet

    You are a legend AlphaFrog!!!!
    Worked like a charm. Thanks heaps!

+ 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. Userform textbox & sheet cells date format do not match
    By KK1234 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-28-2014, 12:56 PM
  2. Recognize text from main sheet and sorting to others.
    By hello44 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 04-01-2014, 10:16 PM
  3. Date picker UserForm to stay always in front of the main UserForm
    By Gabor in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-11-2014, 07:31 AM
  4. [SOLVED] Userform called from another userform textbox - unload problem
    By barryleajo in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 03-27-2013, 01:09 PM
  5. Userform Textbox Sorting
    By blacktour in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-28-2005, 10:41 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