Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Win98SE Office 2000. (NEWBIE ALERT). What I would like to do is insert a
user form into a macro asking the user if the information they are adding is correct before allowing the macro to run. I have the user form with Yes or No, No ends the userform but I can't find a function to insert it. Or as I received no help from another group (wrong one!) is to not allow the macro to run (Via button) if the two drop down boxes and normal cell (for amount) are left blank. Currently the cell link is set to 1 - blank. Anyone have any ideas? TIA Sara |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sara,
I need some help here. When you talk about the information, where is that, on the userform or on a worksheet? And where do the dropdown boxes come into play, and what sort of dropdowns are they, data validation, worksheet forms, control toolbox, or userforms? Give us a bit more detail of what you are trying to do, and what you have built so far, and I am sure we can help. -- HTH Bob Phillips ... looking out across Poole Harbour to the Purbecks (remove nothere from the email address if mailing direct) "sara" wrote in message ... Win98SE Office 2000. (NEWBIE ALERT). What I would like to do is insert a user form into a macro asking the user if the information they are adding is correct before allowing the macro to run. I have the user form with Yes or No, No ends the userform but I can't find a function to insert it. Or as I received no help from another group (wrong one!) is to not allow the macro to run (Via button) if the two drop down boxes and normal cell (for amount) are left blank. Currently the cell link is set to 1 - blank. Anyone have any ideas? TIA Sara |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello Bob
I have two drop down boxes in a workbook that the user selects product and language (from another workbook called Dbase). The drop downs were drawn on the worksheet using forms toolbar. Under the drop downs I have normal cells that the macro copies into another sheet for the generation of a manifest, the macro then clears the cells by turning the cell link back to 1 (blank). The quantity box is just number format for the actual number of sachets being dispatched, the macro has been copied from another author and adapted to my needs as follows; Sub ADD_PRODUCT() ' ' ADD PRODUCT TO CHECK WEIGH SHEET Macro ' Macro recorded 21/03/2004 by sara ' HIDE UPDATE FROM USER Application.ScreenUpdating = False Sheets("DATA").Select Range("A1").Select Selection.CurrentRegion.Select ' check for empty table If Range("a2") < "" Then Selection.End(xlDown).Select End If ActiveCell.Offset(1, 0).Range("A1").Select Sheets("INPUT").Select Range("SACHETS").Select Application.CutCopyMode = False Selection.Copy Sheets("DATA").Select ActiveSheet.Paste ActiveCell.Offset(0, 1).Range("a1").Select Sheets("INPUT").Select Range("CODE").Select Application.CutCopyMode = False Selection.Copy Sheets("DATA").Select Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _ False, Transpose:=False ActiveCell.Offset(1, 0).Range("a1").Select Sheets("input").Select Range("b1").Select Selection.ClearContents Range("B1").Select ActiveCell.FormulaR1C1 = "1" Sheets("input").Select Range("d12").Select Selection.ClearContents End Sub So to recap, I would like a user form or pop-up to ask the user if they are sure the information they want copied is correct and/or if any of the three requirements are not met, the button (form control) associated with the macro would be inactive. Does this make sense? Sara |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Morning Sara,
I think this will address the message part of your needs, but I am still not clear on the second part. You say that '... and/or if any of the three requirements are not met, the button (form control) associated with the macro would be inactive ...' . What 3 requirements, and where does this button (form control) come into it? I am not clear as to what this is, or how to make it inactive. I have also tidied up your code a bit to make it easier to read Sub ADD_PRODUCT() Dim ans As Long ' ' ADD PRODUCT TO CHECK WEIGH SHEET Macro ' Macro recorded 21/03/2004 by sara ' HIDE UPDATE FROM USER Application.ScreenUpdating = False Sheets("DATA").Select Range("A1").CurrentRegion.Select ' check for empty table If Range("A2") < "" Then Selection.End(xlDown).Select End If ans = MsgBox("Continue with Copy?", vbYesNo, "Check Weight Sheet") If ans = vbYes Then Sheets("INPUT").Range("SACHETS").Copy Sheets("DATA").Select ActiveSheet.Paste Sheets("INPUT").Range("CODE").Copy Sheets("DATA").PasteSpecial Paste:=xlValues, _ Operation:=xlNone, _ SkipBlanks:=False, _ Transpose:=False With Sheets("input").Range("B1") .ClearContents .Value = "1" End With Sheets("input").Range("D12").ClearContents End If Application.ScreenUpdating = True End Sub -- HTH Bob Phillips ... looking out across Poole Harbour to the Purbecks (remove nothere from the email address if mailing direct) "sara" wrote in message ... Hello Bob I have two drop down boxes in a workbook that the user selects product and language (from another workbook called Dbase). The drop downs were drawn on the worksheet using forms toolbar. Under the drop downs I have normal cells that the macro copies into another sheet for the generation of a manifest, the macro then clears the cells by turning the cell link back to 1 (blank). The quantity box is just number format for the actual number of sachets being dispatched, the macro has been copied from another author and adapted to my needs as follows; Sub ADD_PRODUCT() ' ' ADD PRODUCT TO CHECK WEIGH SHEET Macro ' Macro recorded 21/03/2004 by sara ' HIDE UPDATE FROM USER Application.ScreenUpdating = False Sheets("DATA").Select Range("A1").Select Selection.CurrentRegion.Select ' check for empty table If Range("a2") < "" Then Selection.End(xlDown).Select End If ActiveCell.Offset(1, 0).Range("A1").Select Sheets("INPUT").Select Range("SACHETS").Select Application.CutCopyMode = False Selection.Copy Sheets("DATA").Select ActiveSheet.Paste ActiveCell.Offset(0, 1).Range("a1").Select Sheets("INPUT").Select Range("CODE").Select Application.CutCopyMode = False Selection.Copy Sheets("DATA").Select Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _ False, Transpose:=False ActiveCell.Offset(1, 0).Range("a1").Select Sheets("input").Select Range("b1").Select Selection.ClearContents Range("B1").Select ActiveCell.FormulaR1C1 = "1" Sheets("input").Select Range("d12").Select Selection.ClearContents End Sub So to recap, I would like a user form or pop-up to ask the user if they are sure the information they want copied is correct and/or if any of the three requirements are not met, the button (form control) associated with the macro would be inactive. Does this make sense? Sara |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Newbie Questions | Excel Discussion (Misc queries) | |||
Newbie Questions ? | New Users to Excel | |||
Newbie Questions - X Axis and Data Range | Charts and Charting in Excel | |||
Newbie questions on spreadsheet | Excel Worksheet Functions | |||
newbie questions | Excel Worksheet Functions |