4 July 2011 • 2 Comments
If you get the error – Method ‘CopyFromRecordset’ of object ‘Range’ failed
Do what this guy says
http://www.ozgrid.com/forum/showthread.php?t=32105&page=1
[vba]
Dim i as Long
i = 1
For Each fld In rst.Fields
‘ Print out column names
wsSheet.Cells(2, i).Value = fld.Name
i = i + 1
Next fld
Dim j As Long, k As Long
With wsSheet ‘ this is the sheet you want the output on…
For j = 1 To rst.RecordCount
For k = 1 To rst.Fields.Count
If IsNull(rst(k – 1)) Then
.Cells(j + 2, k) = Empty
Else
If Len(rst(k – 1)) > 255 Then
For i = 0 To Int(Len(rst(k – 1)) / 255)
.Cells(j + 2, k).Value = .Cells(j + 2, k).Value & Mid(rst(k – 1), (i * 255) + 1, 255)
Next i
Else
.Cells(j + 2, k).Value = rst(k – 1)
End If
End If
Next k
rst.MoveNext
Next j
End With
[/vba]
Just FYI to others using this code. You must set up a few properties in the Record Set before the .RecordCount property will be available or it will only return (-1) and the code will not run.
Specifically, you will need to add (rsMyRecordset.CursorType = adOpenStatic)
and (rsMyRecordset.CursorLocation = adUseClient) prior to opening the recordset.
enjoy!
Category: Excel/VBA
13 April 2011 • No Comments
Did you get an email with a “mensa quiz” excel sheet attached?
The questions go like – 24 H in a D, 9 P in S A etc
heres a little macro that will make you look 10x brighter than you are…
Sub SolveIt()
Dim x As String, rng As Range, cel As Range
With ActiveSheet
For i = 8 To 40
Dim rangeVar As String
rangeVar = “f” & i & “:bw” & i
Set rng = .Range(rangeVar)
x = “”
For Each cel In rng
If (cel.Value <> “0”) And (cel.Value <> “1”) Then
x = x & cel.Value
End If
Next
rangeVar = “d” & i
.Range(rangeVar).Value = x
Next i
End With
End Sub
Category: Uncategorized
19 October 2010 • 3 Comments
first, get your firmware to version 4.2. if youre on 4.3 this instruction set wont work
copy the bootmii installed and the banner bomb v2 (for sys menu 4.2) to the SD card root.
make an app folder in the sd root, and add in the apps for IOS 58, IOS236, cIOS 249, cIOS 222 and Usb loader
1) Install the hbc [Press (Wii), Data Management, Channels, SD. Then insert the card. It should either pop up Load boot.dol/elf? or freeze. Continue as per instructions on screen]
2) next install IOS58 [very straight forward, needs internet connection!]
3) Re-install hbc (so that it starts using ios58 – USB 2.0 speed hdd access)
4) now install Ios236 (remember to say you are NOT gonna do piracy!) [needs internet connection] this re-introduces the trucha bug
5) now install Cios249 (follow the steps given here – http://gwht.wikidot.com/ios249 ) [needs internet connection] (the app is probably called cIOSX_rev20b-Installer)
6) Now install cios222 [needs internet connection] (the app is called cios_installer)
7) Then install the configurable usb loader – and you’re done!
Category: Uncategorized
13 October 2010 • No Comments
Category: Uncategorized
13 October 2010 • No Comments
Category: Uncategorized