16 December 2005 by Ross McLean
Theres a lot of code out there for getting the windows colour picker dialog, but it can be hard to get a RGB code out of this. For example, if you want to set the colour of a form text box, then get it's RGB value to colour a worksheet cell. (That's what i used it for anyway!)
Heres one method:
Private Declare Function GetSysColor
Lib "user32" _
(ByVal nIndex
As Long) As Long
<blockquote>Function GetRGBColors
(ByVal oColor
As OLE_COLOR
)
If oColor
And &H80000000
Then
oColor = GetSysColor
(oColor
And &HFF&
)
End If
GetRGBColors = Array
( _
(oColor
And &HFF&
), _
(oColor
And &HFF00&
) \ &H100, _
(oColor
And &HFF0000
) \ &H10000
)
End Function
Sub RGB()
Dim vRGB() As Variant
vRGB = (GetRGBColors(ActiveCell.Interior.Color))
MsgBox "Red " & vRGB(0) & ", Green " _
& vRGB(1) & ", Blue " & vRGB(2)
End Sub
Tags: Examples, VBA
Categories: Code •
No Comments »
15 December 2005 by Ross McLean
Following a question in JMT I wrote this UDF, it finds the first lower case letter in a cell
Public Function FindLower(cell As Object)
'''Finds the first lower case letter in a cell
If cell.Cells.Count 1 Then
FindLower = "Error - enter only one cell"
Exit Function
End If
For i = 1 To Len(cell.Text)
If Asc(Mid(cell.Text, i, 1))> 90 Then '90 = "Z"
FindLower = i
Exit Function
End If
Next
FindLower = "No Find Mister"
End Function
To use this in a speadsheet, copy the above code, goto Excel and press Alt+F11 (press them together). The visual basic editor will open. Goto the insert menu and click on "moduel". This will create a new moduel, paste the code into this and close the VB editor down.
Back in excel call the function with
=Findlower(a1)
Tags: Examples, VBA
Categories: Code •
No Comments »
15 December 2005 by Ross McLean
This is interesting! mostly I don't agree with it.
Office 12 is an upgrade I wouldn't mind paying for, that is, assuming that work didn't let us get free copies. Those are big words for me, considering my "I Hate Microsoft" series of blog entries. I can imagine making documents faster with Office 12, or at least I can imagine making better looking documents in the same amount of time. Excel, which has been less functional for me than the spreadsheet program I used on my Apple IIe, looks like it will be come a useful tool for data analysis.
As far as I'm aware Excels ability to analyse data has stayed the same, there are about 10 new functions, and no new chart types. POPPER 3-D charts are still not supported.
... the UI revamp, that it's more than a marketing trick. The conventional wisdom out there is "Everything I need was in office [95, 97, 2000]." (For me it was Word 95). They collected a ton of data (including over a billion Office sessions) that told a different story. On a list of the top ten most requested features for Office: four of them were already in Office.
The new IU looks good, but i bet it will throw up a host of problems, It will also mean a load of new coding for controlling menu bars - if they still work in the same way, which I doubt they will now, could balls up my dictor app's.
Another observation from the data was that the average user spends more time with Office (2.6 hrs/day) than they do with their spouse (2.4 hrs/day). When you take 400 million users * 2.6 hrs/day, it seems worth improving that experience.
Well, it's about time that changed, nice looking software or not!
Tags: MS, UI, XL 2007
Categories: General •
No Comments »
15 December 2005 by Ross McLean
This is quite cool some kind of drum machine build in excel! Although it does use a .dll, still cool all, the same!
Tags: WTF
Categories: Addins, White Noise •
No Comments »
14 December 2005 by Ross McLean
My web site is methods in excel (www.methodsinexcel.co.uk), but i find that it's not always the best way for me to put info up, so I'm giving this a whril too. If i like it i think i'll move to a blog full time.
Tags: Blogs, News!
Categories: White Noise •
5 Comments »