+ Reply to Thread
Results 1 to 7 of 7
  1. #1
    Forum Contributor
    Join Date
    02-12-2010
    Location
    india
    MS-Off Ver
    Excel 2003
    Posts
    111

    user form not work

    hi
    user form having error also not work with protected sheet how can from change from protected to unprotected automatically and once the data added user from can protect the sheet automatically pl help to code this will highly appreciated thanks.
    Attached Files Attached Files
    Last edited by jay11; 03-17-2010 at 03:58 PM.

  2. #2
    Forum Moderator Richard Buttrey's Avatar
    Join Date
    02-15-2008
    Location
    Grappenhall, UK
    MS-Off Ver
    Excel for Windows & Mac - all versions.
    Posts
    5,826

    Re: user form not work

    Hi,

    I've not checked all your code but the first bit that crashes is the code in the click event of the Enter Data button. This refers to sheets called 'Historical Data" and "Trade Entry", neither of which are sheet names.

    HTH
    Richard Buttrey

    If this was useful then please rate it appropriately.

    Click the small star icon at the bottom left of my post.

  3. #3
    Forum Contributor
    Join Date
    02-12-2010
    Location
    india
    MS-Off Ver
    Excel 2003
    Posts
    111

    Re: user form not work

    hi Richard Buttrey
    i am new to VB coding so pl bear with me
    i change the same as u suggested still not working it give the error msg as"run time error 91"
    object variable or with block variable not set thanks for help
    Last edited by jay11; 03-17-2010 at 03:57 PM.

  4. #4
    Forum Moderator Richard Buttrey's Avatar
    Join Date
    02-15-2008
    Location
    Grappenhall, UK
    MS-Off Ver
    Excel for Windows & Mac - all versions.
    Posts
    5,826

    Re: user form not work

    Hi,

    Can you confirm exactly what it is you have changed?
    Better still upload your revised workbook so we can take a look.

    Rgds
    Richard Buttrey

    If this was useful then please rate it appropriately.

    Click the small star icon at the bottom left of my post.

  5. #5
    Forum Contributor
    Join Date
    02-12-2010
    Location
    india
    MS-Off Ver
    Excel 2003
    Posts
    111

    Re: user form not work

    here is the new wb which give error msg
    Attached Files Attached Files

  6. #6
    Forum Guru
    Join Date
    01-12-2007
    Location
    New Jersey
    Posts
    1,792

    Re: user form not work

    I took a quick look at your code, and I crashed on this line:

    Code:
    R = IIf(RngEnd.Row < Rng.Row, Rng.Row, RngEnd.Row + 1)
    Since you have defined the variable "R" as a Range, you have to precede it with Set.

    The code should read
    Code:
    Set R = IIf(RngEnd.Row < Rng.Row, Rng.Row, RngEnd.Row + 1)
    Also, the fomula in the same bit of code will return a number, not a cell range. So, there will be a mismatch. Why not walk us through what you want to do and we can try to help better.

  7. #7
    Forum Contributor
    Join Date
    02-12-2010
    Location
    india
    MS-Off Ver
    Excel 2003
    Posts
    111

    Re: user form not work

    hi
    actual user form have to take the data from the "Brought sheet" and add the newly added from data and save in the "records"W sheet .but before adding the data to "Record "W Sheet
    it must check for duplicate data in "Record" W sheet if it find the same "ticker"symbol in "Record sheet" it will give the msg."Ticker already exist in records" then if still user want to add the data .program.should allow the user to add data by giving the msg."anyway Add the Ticker to Records" Yes or No option button.
    otherwise code work without the cheeking the duplicate Ticker here i am attaching the WorkBook which work.but i want to add the code to check the duplicate entry.i hope i explain the way u can get what i want to do.
    Attached Files Attached Files

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.2.0