Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. cummings54

    Solver clash with custom Excel function

    try adding the Application.Volatilestatement to you user defined function.
  2. cummings54

    converting excel graph to jpg or other graphic for word document

    Try the microsoft link http://office.microsoft.com/en-us/excel/HP030770691033.aspx
  3. cummings54

    Macro to Reverse Order

    electricpete, If formulas you want, formulas you get :-D Just change the array assignment as follows: a = Selection.Formula
  4. cummings54

    Macro to Reverse Order

    Roger, I've made some minor changes to the rest code as follws: Sub test() Dim b As Range a = Selection Set b = Selection.Cells(1, 1) n = UBound(a) For irow = 0 To n - 1 b.Offset(irow, 0).Formula = a(n - irow, 1) b.Offset(irow, 1).Formula = a(n - irow, 2) b.Offset(irow...
  5. cummings54

    Macro to Reverse Order

    Here's another approach you may find interesting. Sub test() Dim b As Range a = Selection Set b = Selection.Cells(1, 1) n = UBound(a) For irow = 0 To n - 1 b.Offset(irow, 0).Formula = a(n - irow, 1) Next End Sub
  6. cummings54

    Inch/Metric toggle with a button

    The macro button is an ActiveX control. Use the menu item View:Toolbars:Control Toolbox and ensure that the Control Toolbox is checked. Click the View Code button on the tool bar which will open VBA editor showing the event procedure triggered by clicking the toggle control as follows: Private...
  7. cummings54

    Inch/Metric toggle with a button

    I've provided a link to a sample workbook. It has a toggle button that will change values and unit symbols based on the state of the toggle button. Cells of interest have been identified using a range name. These include units values and units symbols. The example is simple showing just...
  8. cummings54

    Giving Time Estimates?

    Here's a simple template that I use to match staff hour to project hours graphically. Right click in the planning area to toggle the shading and change to hours totalshttp://files.engineering.com/getfile.aspx?folder=9cb5f107-5a57-43a4-9c30-e6255f30ea71&file=StaffPlanning.xlt
  9. cummings54

    prevent multiple decimal points during textbox input

    Here's a little snippet that makes use of the keypress event Dim LastKeyAscii As Variant Dim LastTextBox1 As String Private Sub TextBox1_GotFocus() LastKeyAscii = 0 End Sub Private Sub TextBox1_KeyPress(ByVal KeyAscii As MSForms.ReturnInteger) If KeyAscii = 46 And (LastKeyAscii = KeyAscii)...
  10. cummings54

    How to trigger a program to run automatically

    You can use the intersect method to tell if a changing cell in one of interest. For example, Private Sub Worksheet_Change(ByVal Target As Range) If Intersect(Target, Range("A1,B1")) Is Nothing Then Exit Sub Range("C1").Value = Range("A1").Value + Range("B1").Value End Sub
  11. cummings54

    Multivariable regression in Excell

    There are limits to what LINEST can do. Looking at the add trendline feature avalable in Excel charting you can see that only polynomials of order 6 can be fitted. This may be a hint that when regressions having more than 7 coefficients in the approximating equation, there may be computational...
  12. cummings54

    Macro to exit spreadsheet file

    Whoops! forgot the spreadsheet linkhttp://files.engineering.com/getfile.aspx?folder=66930016-053f-44e0-8537-5103747b6e5c&file=Password_Sample.xls
  13. cummings54

    Macro to exit spreadsheet file

    Here's some sample code you can try to protect a macro with a password. Enjoy
  14. cummings54

    Multivariable regression in Excell

    If you include the power terms you will no longer have a linear system. Techniques for non-linear regression need to be applied. The exception, as jghrist notes, is when all terms are power terms and you can take the logarithm and "linearize" the equation. For non-linear fitting it may be...
  15. cummings54

    Multivariable regression in Excell

    To include the products x1*x2, x1^2*x2, x1^3*x2 as well, use another variation as follows: =LINEST(Y1:Y10,B1:B10^{1,2,3,0,0,0,1,2,3}*C1:C10^{0,0,0,1,2,3,1,1,1},TRUE,TRUE)
  16. cummings54

    Multivariable regression in Excell

    With a little variation you can include multivariable with their powers by building an array. Suppose your X1's are in B1:B10 and x2's are in C1:C10. Then =LINEST(Y1:Y10,B1:B10^{1,2,3,0,0,0}*C1:C10^{0,0,0,1,2,3},TRUE,TRUE) will fit first, second and third order in each independent variable. Of...
  17. cummings54

    Multivariable regression in Excell

    I some cases you don't even need to built extra columns =LINEST(Y1:Y10,X1:X10^{1,2,3},TRUE,TRUE) will fit a cubic polynomial
  18. cummings54

    Option Button & List Boxes

    Have you looked at the ControlSource property? Listboxes and option buttons on a userform have a built-in link to the worksheet through the ControlSource property. When using a UserForm the control source needs a worksheet reference as well as a cell reference so the ControlSource text string...
  19. cummings54

    Concatenate two listboxes in a textbox

    use the following code snippet in the userform code pane Private Sub ListBox1_Click() TextBox1.Text = "" & ListBox1.Text End Sub Private Sub ListBox2_Click() With TextBox1 .Text = .Text & ListBox2.Text End With End Sub Of course this assumes ... you've called your listboxes ListBox1 &...
  20. cummings54

    How can I get the number of activecell with VBA ?

    Your question seems a bit vague. What is your host application? Excel? What number? row number, column number, cell value, page number the cell appears on, etc.

Part and Inventory Search

Back
Top