+ Reply to Thread
Results 1 to 9 of 9

Excel Form (VBA) validation help needed urgently

  1. #1
    Registered User
    Join Date
    09-21-2012
    Location
    earth
    MS-Off Ver
    Excel 2007
    Posts
    9

    Excel Form (VBA) validation help needed urgently

    Hello all, Im customising some code I got online at the page http://www.contextures.com/xlForm02.html
    I need some help editing the code in red. Basically, the code is used in conjunction with an excel form, so the user form is on one worksheet and the data collected is stored in another sheet. Currently there's a validation check to ensure that all cells have data entered. I want to adjust it since there are specific cells I wont need data in. So i figure the key piece of code is the line
    Please Login or Register  to view this content.
    so i want to adjust it to something like If Application.CountA(myRng) <> myRng.Cells.Count excluding cell D13. Im just not sure of the correct syntax. Hope i was clear enough. Thank you all in advance for your speedy responses.

    Please Login or Register  to view this content.

  2. #2
    Registered User
    Join Date
    09-20-2012
    Location
    Wellington, New Zealand
    MS-Off Ver
    Excel 2003
    Posts
    63

    Re: Excel Form (VBA) validation help needed urgently

    You should be able to use:

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    09-20-2012
    Location
    Wellington, New Zealand
    MS-Off Ver
    Excel 2003
    Posts
    63

    Re: Excel Form (VBA) validation help needed urgently

    Oh, if you want to remove D13, take it out of your line "myCopy = "D5,D7,D9,D11,D13"" change to myCopy = "D5,D7,D9,D11"

  4. #4
    Registered User
    Join Date
    09-21-2012
    Location
    earth
    MS-Off Ver
    Excel 2007
    Posts
    9

    Re: Excel Form (VBA) validation help needed urgently

    Thanks Blobbles, i'll try it

  5. #5
    Registered User
    Join Date
    09-21-2012
    Location
    earth
    MS-Off Ver
    Excel 2007
    Posts
    9

    Re: Excel Form (VBA) validation help needed urgently

    ok im still having a problem, this one may not be restricted to the validation.

    im getting an "Application Defined or Object Defined Error" error at line this line
    Please Login or Register  to view this content.
    So basically, the code is supposed to get the data in the MyCopy cells on the input sheet, then copy the contents to the salesdata sheet. on the sales data sheet, its supposed to start inputting the contents that were copied into cell D3, contiguously within that sheet. so it would just paste into cell D3,E3,F3,H3 Etc etc.I think i may have some syntax errors. Can anyone assist??
    again, a link to the original sample code i got online is at:
    http://www.contextures.com/xlForm02.html#edit


    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    09-20-2012
    Location
    Wellington, New Zealand
    MS-Off Ver
    Excel 2003
    Posts
    63

    Re: Excel Form (VBA) validation help needed urgently

    You pretty much need to upload the sheet with all sensitive information taken out. There could be lots of reasons for this...

  7. #7
    Registered User
    Join Date
    09-21-2012
    Location
    earth
    MS-Off Ver
    Excel 2007
    Posts
    9

    Re: Excel Form (VBA) validation help needed urgently

    humm, but thats the entire code their i've posted

  8. #8
    Registered User
    Join Date
    09-20-2012
    Location
    Wellington, New Zealand
    MS-Off Ver
    Excel 2003
    Posts
    63

    Re: Excel Form (VBA) validation help needed urgently

    OK, its because you haven't defined the value of oCol. As such it tries to paste the data to column 0, which doesn't exist of course!

    Please Login or Register  to view this content.

  9. #9
    Registered User
    Join Date
    09-21-2012
    Location
    earth
    MS-Off Ver
    Excel 2007
    Posts
    9

    Re: Excel Form (VBA) validation help needed urgently

    thanks for the help Blobbles! that did the trick. have a great day!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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