Consulting

Page 1 of 2 1 2 LastLast
Results 1 to 20 of 22

Thread: Solved: Form not Uploading

  1. #1
    VBAX Regular
    Joined
    Oct 2008
    Posts
    41
    Location

    Solved: Form not Uploading

    Hi there,
    Can someone please assist me with the attached.

    Basically, C3 cell has a change event to run the Upload macro but it's not working as it should. Also I used to upload from one closed or open workbook now I up load from various titles closed or open workbooks based on what I input into C3.

    Fyi - Workbooks are all contained within one File Folder with various sub-folders in side. Also it worked fine until I started to use various workbooks and or various sheets.

    One more thing C2 & L2 have IF Statements attached to them, can't get the Conditional formatting to work to make "#NA" font white.

    Hope this is not to confusing, any help would be greatly appreciated.

    Thank you very much,
    Holland

  2. #2
    Knowledge Base Approver VBAX Wizard p45cal's Avatar
    Joined
    Oct 2005
    Location
    Surrey UK
    Posts
    5,875
    See how you get on with the attached.
    Files should be in the same folder as the Form Master file (not in subfolders).
    There may be a few glitches.
    p45cal
    Everyone: If I've helped and you can't be bothered to acknowledge it, I can't be bothered to look at further posts from you.

  3. #3
    VBAX Regular
    Joined
    Oct 2008
    Posts
    41
    Location
    Hi p45cal,
    Works much better then my version THANK YOU very much,

    Now what changes I have done not working though,

    I removed the Upload and Clear button and want C3 to be the main source of control. When C3 is populated it loads great, now if C3 is blank or deleted can I get the below to happen, as well as get a pop up message if wrong Project code is entered currently if I enter a75 I get a run time error.

    See below 2 codes, also when workbbok is open can I get a pop up with a message to use C3 to enter Project #,


    [VBA]Sub Clear()
    If Sheets("Tool Audit List").Range("C3").Value = "" Then
    Sheets("Tool Audit List").Range("B7:H10004").ClearContents
    End If
    ----
    With wsLog
    If .Range("C3") = "" Then
    MsgBox "Please Confirm Project Number"
    .Range("C3").Select
    GoTo Endo
    Else
    Findval = .Range("C3")
    End If
    End With

    End Sub
    OR
    ------

    Private Sub cmdbtnHelp()

    MsgBox "Please Confirm Project No,", _
    vbInformation, "Help"

    End Sub[/VBA]


    thank you again
    Holland

  4. #4
    VBAX Regular
    Joined
    Oct 2008
    Posts
    41
    Location
    Hi p45cal,
    I figured out the Pop Up Message Macro As Worksheet Opens,

    [VBA]Option Explicit
    Private Sub Workbook_Open()

    Dim msg As Long

    msg = MsgBox("Please enter project # into cell C3", vbOKOnly, "Test Test")

    End Sub[/VBA]

  5. #5
    Administrator
    VP-Knowledge Base
    VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,489
    Location
    Check first to avoid unneccessary message
    [VBA]
    If Range("C3") = "" then
    msg = MsgBox("Please enter project # into cell C3", vbOKOnly, "Test Test")
    End If
    [/VBA]
    MVP (Excel 2008-2010)

    Post a workbook with sample data and layout if you want a quicker solution.


    To help indent your macros try Smart Indent

    Please remember to mark threads 'Solved'

  6. #6
    VBAX Regular
    Joined
    Oct 2008
    Posts
    41
    Location
    Thank you mdmackillop,,
    Can't get it exactly to work, maybe I am not placing it in the wrong part of the module. Suggestions?

    Thanks,
    Holland

    Quote Originally Posted by mdmackillop
    Check first to avoid unneccessary message
    [vba]
    If Range("C3") = "" then
    msg = MsgBox("Please enter project # into cell C3", vbOKOnly, "Test Test")
    End If
    [/vba]

  7. #7
    Administrator
    VP-Knowledge Base VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,489
    Location
    Sorry,
    I missed the Sheet reference from my code. Try this instead
    [vba]
    Private Sub Workbook_Open()
    Dim msg As Long
    Dim TestRange As Range

    Set TestRange = Sheets(1).Range("C3") '<=== Adjust as required
    If TestRange = "" Then
    msg = MsgBox("Please enter project # into cell C3", vbOKOnly, "Test Test")
    Application.Goto TestRange
    End If
    End Sub

    [/vba]
    MVP (Excel 2008-2010)

    Post a workbook with sample data and layout if you want a quicker solution.


    To help indent your macros try Smart Indent

    Please remember to mark threads 'Solved'

  8. #8
    Administrator
    VP-Knowledge Base VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,489
    Location
    Currently when the correct Text is entered in C3 the Upload macro runs perfectly.
    1. What I would like to add if the wrong text is entered into C3, I would like a pop up window stating "Please reconfirm Project #" and I would then like "C3" to clear contents, and select C3.
    2. I would also like to have the "Clear" macro run as well when "C3" delete key is used or the space bar, hopefully we can put 2 events in one cell.
    More or less I don't want any error messages because the end users all somewhat new to excel.
    Better to use Data Validation to prevent your users from making illegal entries in the first place.
    Last edited by mdmackillop; 03-21-2010 at 11:32 AM. Reason: attachment removed
    MVP (Excel 2008-2010)

    Post a workbook with sample data and layout if you want a quicker solution.


    To help indent your macros try Smart Indent

    Please remember to mark threads 'Solved'

  9. #9
    VBAX Regular
    Joined
    Oct 2008
    Posts
    41
    Location
    Hi mdmackillop,
    Cannot use Data Validation, that would be the easiest fix but my sample only shows 3 variables (A1, A2, A8 workbook) in reality there are many workbooks and new projects/workbooks get added on a daily bases.

    I do require a Pop up Window similar to the validation but in a script, also when C3 is deleted or cleared I'd like the Clear macro to run. Please keep in mind that there is already a macro running once text is entered into C3.

    Please help and thank you again,

    Holland

    Quote Originally Posted by mdmackillop
    Better to use Data Validation to prevent your users from making illegal entries in the first place.

  10. #10
    VBAX Regular
    Joined
    Oct 2008
    Posts
    41
    Location
    mdmackillop,
    You are a genius, I removed the Data validation and it is somewhat working Thank you, now all I need is the "Clear" macro to run when "C3" is deleted or the space bar is used.

    Fyi - When the space bar is used in "C3" the Clear macro does run, when I use delete though the Clear macro does not run.

    I feel we are really close,...

    Thank you,
    Holland

    Quote Originally Posted by mdmackillop
    Better to use Data Validation to prevent your users from making illegal entries in the first place.

  11. #11
    Administrator
    VP-Knowledge Base VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,489
    Location
    I'd stick with the Validation if possible. I've added a blank in hidden row 2 which allows it to be entered and will trigger the Clear macro
    MVP (Excel 2008-2010)

    Post a workbook with sample data and layout if you want a quicker solution.


    To help indent your macros try Smart Indent

    Please remember to mark threads 'Solved'

  12. #12
    VBAX Regular
    Joined
    Oct 2008
    Posts
    41
    Location
    Ok I could stick with the Validation as I just test various other workbook projects and they did load fine, thank y. Somewhat still confused on the clear macro not working 100% for me. C3 + Clear macro works with the space bar great, still not working with delete though,. Any thoughts

    Holland
    and thank you again.

  13. #13
    Administrator
    VP-Knowledge Base VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,489
    Location
    Merged cells!!!!!
    These always cause problems. Unmerge C3 & D3 or adjust the Target Address in your worksheet change code.
    MVP (Excel 2008-2010)

    Post a workbook with sample data and layout if you want a quicker solution.


    To help indent your macros try Smart Indent

    Please remember to mark threads 'Solved'

  14. #14
    VBAX Regular
    Joined
    Oct 2008
    Posts
    41
    Location
    mdmackillop,
    THANK YOU! Did exactly as you instructed and works like a charm! I sincerely appreciate your assistance and everyone's assistance on this site. By far the best site I have ever used.

    Just going through vigorous testing now. And setting up the print to last cell used.



    Holland

  15. #15
    Moderator VBAX Wizard Aussiebear's Avatar
    Joined
    Dec 2005
    Location
    Queensland
    Posts
    5,059
    Location
    Rather than using Merged Cells, try Centre Across Selection
    Remember To Do the Following....
    Use [Code].... [/Code] tags when posting code to the thread.
    Mark your thread as Solved if satisfied by using the Thread Tools options.
    If posting the same issue to another forum please show the link

  16. #16
    VBAX Regular
    Joined
    Oct 2008
    Posts
    41
    Location
    Thank you Aussiebear, tried it and works well.

    Holland

  17. #17
    VBAX Regular
    Joined
    Oct 2008
    Posts
    41
    Location
    mdmackillop,
    Ok after a lot of testing no errors were found,.. Only concern is when I convert it into a template nothing works. Only reason I want to convert to template because of various users... Any suggestions.

    Thank you,
    Holland

    Quote Originally Posted by mdmackillop
    Merged cells!!!!!
    These always cause problems. Unmerge C3 & D3 or adjust the Target Address in your worksheet change code.

  18. #18
    Administrator
    VP-Knowledge Base VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,489
    Location
    Have you saved the new workbook before running the code. I didn't have any problems with it.
    MVP (Excel 2008-2010)

    Post a workbook with sample data and layout if you want a quicker solution.


    To help indent your macros try Smart Indent

    Please remember to mark threads 'Solved'

  19. #19
    VBAX Regular
    Joined
    Oct 2008
    Posts
    41
    Location
    Yes did a save as Excel Template,...

    Quote Originally Posted by mdmackillop
    Have you saved the new workbook before running the code. I didn't have any problems with it.

  20. #20
    VBAX Regular
    Joined
    Oct 2008
    Posts
    41
    Location
    could it be that I am working in 2007 Excel and saving as a 1997-2003 template instead of 2007?

Posting Permissions

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