Re: $$Excel-Macros$$ Permutations and combinations

2010-04-15 Thread elit
If you are looking for these 1+19 2+18 3+17 4+16 5+15 6+14 7+13 8+12 9+11 then the interger you are looking for is 9, or to calculate 19/2. On Apr 15, 7:52 am, "Drayton, Michael E " wrote: > Dilip, > > I hope you are well. > > I think this is fraught with options and complications. > I think it

$$Excel-Macros$$ Re: how to query if a given sheet exists?

2010-04-11 Thread elit
Just for fun (or for a different approach), here is a third way: Public Function WsIndex(WsName As String) As Integer On Error Resume Next WsIndex = ThisWorkbook.Worksheets(WsName).Index End Function Public Sub test() If 0 <> WsIndex("Budget 2011") Then MsgBox "Budget 2011 exi

$$Excel-Macros$$ Re: Single Data Type Number Length Growing

2010-04-07 Thread elit
My "debugging" in a prior response was intended to show how numbers are displayed. Your single values may always contain some "fuzz". I believe that unless declared otherwise, values within calculation are converted to double, so the double data type is often preferred to single unless for some re

$$Excel-Macros$$ Re: Single Data Type Number Length Growing

2010-04-07 Thread elit
Try storing results or using double. Sub test() Dim d As Double Dim s As Single d = 0.004 Debug.Print "d", d, d + 0.1 s = 0.004 Debug.Print "s", s, s + 0.1 d = d + 0.1 Debug.Print "d + 0 .1", d s = s + 0.1 Debug.Print "s + 0.1", s End Sub Immediate Window:

$$Excel-Macros$$ Re: convert variant() to string

2010-04-03 Thread elit
I suspect your range "data_range" contains more than one cell. If you really want to put one value into header then either header = Range("data_area").Offset(0, 1)(0).Value or header = Range("data_area").Offset(0, 1)(0, 0).Value should work. I just joined this group a few minutes ago. I hope this