Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
Function or VBA
Hi,
Our company has a "Contract Review" form made up of 5 sheets. There are certain situations when we will want 2 of the sheets to be included in our quotation package to the customer. These 2 sheets contain the specifications the RFQ was generated to. My thought is to put a button on the individual sheets in the Contract Review form. This will enable the estimator to click the button and insert the sheets into the "Quotation" form. Will this be easier to do via FUNCTIONS or VBA? I am currently taking myself through Excel Programming Weekend Crash Cousre. My experience with programming VBA is novice at best. I've written programs for PLC's using ladder logic and also statement list. Just wondering, the learning curve for VBA seems like it might be a while before I can accomplish what I want to do with this. -- TIA AFJr |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
Function or VBA
Following assumptions:
* You are running a single instance of Excel (usually this is the case) * Your Quotations workbook is in a file called Quotations.xls * You want the Active Sheet to be copied after the first worksheet in Quotations.xls The following sub, when assigned to your command button, will copy the active sheet (on which the button is located, presumably) will be copied. If Quotations.xls is not open, an error message is displayed. Private Sub Button1_Click() Dim wsh As Excel.Worksheet Set wsh = Application.ActiveSheet On Error Resume Next wsh.Copy After:=Application.Workbooks("Quotations.xls").Wor ksheets(1) If Err.Number < 0 Then Call MsgBox("Error copying worksheet") End If On Error Goto 0 End Sub On Dec 3, 2:42 pm, AFJr wrote: Hi, Our company has a "Contract Review" form made up of 5 sheets. There are certain situations when we will want 2 of the sheets to be included in our quotation package to the customer. These 2 sheets contain the specifications the RFQ was generated to. My thought is to put a button on the individual sheets in the Contract Review form. This will enable the estimator to click the button and insert the sheets into the "Quotation" form. Will this be easier to do via FUNCTIONS or VBA? I am currently taking myself through Excel Programming Weekend Crash Cousre. My experience with programming VBA is novice at best. I've written programs for PLC's using ladder logic and also statement list. Just wondering, the learning curve for VBA seems like it might be a while before I can accomplish what I want to do with this. -- TIA AFJr |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
Function or VBA
Additionally, if you want the button to not be in your quotations
worksheet, and assuming there's only one button on it, you can use this code: Application.Workbooks("Quotations.xls").Worksheets (wsh.Name).Buttons(1).Delete On Dec 3, 3:52 pm, iliace wrote: Following assumptions: * You are running a single instance of Excel (usually this is the case) * Your Quotations workbook is in a file called Quotations.xls * You want the Active Sheet to be copied after the first worksheet in Quotations.xls The following sub, when assigned to your command button, will copy the active sheet (on which the button is located, presumably) will be copied. If Quotations.xls is not open, an error message is displayed. Private Sub Button1_Click() Dim wsh As Excel.Worksheet Set wsh = Application.ActiveSheet On Error Resume Next wsh.Copy After:=Application.Workbooks("Quotations.xls").Wor ksheets(1) If Err.Number < 0 Then Call MsgBox("Error copying worksheet") End If On Error Goto 0 End Sub On Dec 3, 2:42 pm, AFJr wrote: Hi, Our company has a "Contract Review" form made up of 5 sheets. There are certain situations when we will want 2 of the sheets to be included in our quotation package to the customer. These 2 sheets contain the specifications the RFQ was generated to. My thought is to put a button on the individual sheets in the Contract Review form. This will enable the estimator to click the button and insert the sheets into the "Quotation" form. Will this be easier to do via FUNCTIONS or VBA? I am currently taking myself through Excel Programming Weekend Crash Cousre. My experience with programming VBA is novice at best. I've written programs for PLC's using ladder logic and also statement list. Just wondering, the learning curve for VBA seems like it might be a while before I can accomplish what I want to do with this. -- TIA AFJr- Hide quoted text - - Show quoted text - |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
copy of excel file not showing formulal/function in the function b | Excel Discussion (Misc queries) | |||
LINKEDRANGE function - a complement to the PULL function (for getting values from a closed workbook) | Excel Worksheet Functions | |||
Offset function with nested match function not finding host ss. | Excel Worksheet Functions | |||
Emulate Index/Match combo function w/ VBA custom function | Excel Worksheet Functions | |||
Nested IF Function, Date Comparing, and NetworkDays Function | Excel Worksheet Functions |