+ Reply to Thread
Results 1 to 5 of 5

error in activecell.offset when i open userform

  1. #1
    Forum Contributor
    Join Date
    04-27-2010
    Location
    Lisbon, Portugal
    MS-Off Ver
    Excel 2007
    Posts
    115

    error in activecell.offset when i open userform

    Hi,

    I've created a userform but i can't make it work. I'm having 2 dificulties.

    First - I'm inserted date in the format "dd-mm-yyyy" but it migrates to the worksheet "mm-dd-yyyy"

    Second - When i Run macro in the VBA menu, it works well, but if i close the VBA and open the userform form the selection button i get a run time erro '1004' in this line of code:
    Please Login or Register  to view this content.
    ActiveCell.Value = txtprospect.Value
    Please Login or Register  to view this content.
    I send the form in attach to see if anyone can help me.

    Thanks
    Attached Files Attached Files

  2. #2
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: error in activecell.offset when i open userform

    You need to use CDate when writing the dates to the worksheet. I get no error using the form.
    Remember what the dormouse said
    Feed your head

  3. #3
    Forum Contributor
    Join Date
    04-27-2010
    Location
    Lisbon, Portugal
    MS-Off Ver
    Excel 2007
    Posts
    115

    Re: error in activecell.offset when i open userform

    I'm sorry, but i don't understand.

    Do you mean that instead of using:
    Please Login or Register  to view this content.
    txtdataregisto = Format(Date, "dd-mm-yyyy")
    Please Login or Register  to view this content.
    I should use:
    Please Login or Register  to view this content.
    txtdataregisto = Format(CDate("dd-mm-yyyy"))
    Please Login or Register  to view this content.
    I've tryed and i get a Run Time Error '13' Type mismatch

  4. #4
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: error in activecell.offset when i open userform

    No, I mean that when you send it to the worksheet, you should use CDate(txtdataregisto)

  5. #5
    Forum Contributor
    Join Date
    04-27-2010
    Location
    Lisbon, Portugal
    MS-Off Ver
    Excel 2007
    Posts
    115

    Re: error in activecell.offset when i open userform

    Ok,

    I can't seam to make it work, i'm not sure where or how to use it, this is only the second time i use VBA, but i won't bother you anymore.

    This wasn't the first time that you reply my posts and i apreciate it

    Thanks. Have a nice weekend

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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