-
WSIanSaunders
AskWoody LoungerIf you give the checkboxes useful names, such as Checkbox93 for the one in row 9 column 3 of your set of boxes, you can automate the references:
Sub tryit() Dim sh As New Worksheet Dim iRow As Integer, iCol As Integer Dim ChkBoxValue As Boolean Dim totalDollars As Double Set sh = Worksheets("Sheet1") totalDollars = 0 'Run through the checkboxes by rows and columns For iRow = 1 To 9 For iCol = 1 To 4 ' Get the value of the checkbox in row iRow, column iCol ChkBoxValue = sh.OLEObjects("Checkbox" & iRow & iCol).Object.Value ' Add up the values where the boxes are checked If ChkBoxValue Then totalDollars = totalDollars + sh.Range("a1").Offset(iRow - 1, iCol - 1) End If Next iCol Next iRow MsgBox totalDollars End Sub
This makes it easier to be sure you’re getting the right entries
Ian.
-
WSIanSaunders
AskWoody LoungerSorry
– I use Excel 2000 now, but I thought I remembered InStrRev being in earlier versions.
Memory going with advancing age, I’m afraid!
Ian.
-
WSIanSaunders
AskWoody LoungerInStrRev() finds a string within another one starting from the end, so you could use:
iPos = InStrRev(FileToOpen, "") strPathName = Left(FileToOpen, iPos - 1) strFileName = Right(FileToOpen, Len(FileToOpen) - iPos)
Have fun!
Ian. -
WSIanSaunders
AskWoody LoungerThanks again! I tried the Export/Delete/Import on a smallish file and got a 20% reduction in size.
Ian.
-
WSIanSaunders
AskWoody LoungerWill the standard File Open dialog do what you need?
You can call it from Visual Basic byApplication.Dialogs(xlDialogOpen).Show
Ian.
-
WSIanSaunders
AskWoody LoungerJuly 7, 2003 at 12:07 pm in reply to: SpinButton causes crash (Windows 2000 & Me/Excel 2000) #691684Thanks, Jan. That works for me too! Gee you’re smart!
I’d already tried calling a sub in a normal module from the event sub in the class module – which didn’t work. Presumably the ‘OnTime’ call gets the control completely away from the SpinButton module and allows the Close to proceed properly.
Thanks again.
Ian. -
WSIanSaunders
AskWoody LoungerThanks!
Ian
-
WSIanSaunders
AskWoody LoungerJohn:
Doing a Save As with format ‘Formatted Text (space delimited) (*.prn)’ gives more or less what you want.
Ian.
(Though something like this is more fun:
Sub MakeTextList(rng As Range, strOutFile As String) Dim nRows As Integer, nCols As Integer Dim dProc Dim iFieldWidth() As Integer Dim iWidth As Integer Dim i As Integer, j As Integer Dim strOutput As String Open strOutFile For Output As #1 nRows = rng.Rows.Count nCols = rng.Columns.Count ReDim iFieldWidth(1 To nCols) For j = 1 To nCols iFieldWidth(j) = 0 For i = 1 To nRows iWidth = Len(rng(i, j)) If iFieldWidth(j) < iWidth Then iFieldWidth(j) = iWidth Next i Next j For i = 1 To nRows strOutput = "" For j = 1 To nCols strOutput = strOutput & (strPadded(rng(i, j), iFieldWidth(j) + 1)) Next j 'Probably test here for blank lines Print #1, strOutput Next i Close #1 dProc = Shell("notepad.exe " & strOutFile, vbNormalFocus) AppActivate dProc End Sub Function strPadded(str As String, iLength As Integer) As String Dim i As Integer strPadded = str For i = Len(str) + 1 To iLength strPadded = strPadded & " " Next i End Function
-
WSIanSaunders
AskWoody LoungerNot sure what’s happening, but zeros seem to behave oddly.
With the following formula in some convenient cell
=SUM(IF(COUNTIF(A1:A1000,A1:A1000)=0,0,1/COUNTIF(A1:A1000,A1:A1000)))
and data only in the first 10 rows of column A as follows:
0 a s d f g 0 f 0 0
I get a value of 253.5
Odd!
Ian.
-
WSIanSaunders
AskWoody LoungerThanks for checking, Steve.
Ian.
-
WSIanSaunders
AskWoody LoungerJuly 5, 2003 at 12:42 pm in reply to: SpinButton causes crash (Windows 2000 & Me/Excel 2000) #691343Yes, of course a spinbutton isn’t usually the most logical place to close a workbook. I was half expecting such a comment!
There is a reason, however! I am using a workbook to keep records of scores of a computer game. Spin buttons count wins and losses and after a certain number of games it puts up a MsgBox asking ‘do you want to quit’ . If you click ‘Yes” the workbook is closed. Except that Excel crashes instead which is a nuisance if there are other workbooks open at the time.
After steadily deleting controls and code, I discovered the source of the problem and wondered if it was known. I simplifed the code to its bare essential so there was nothing else that could be causing the problem.
Thanks for the comments!
Ian.
-
WSIanSaunders
AskWoody LoungerThe DATEVALUE worksheet function seems to recognise local settings.
The attached worksheet interprets 20030301 correctly as 1 March 2003 (via 01/03/2003) when I run it with Australian settings. I’ve split the formula between B1 and C1 only for clarity.
Ian.
-
WSIanSaunders
AskWoody LoungerThere’s a web site that discusses the complexities of the Chinese Lunar Calendars at
http://www.chinesefortunecalendar.com/clc/default.htm “]http:// http://www.chinesefortunecalendar.com/clc/default.htm [/url]Have fun!
Ian.
-
WSIanSaunders
AskWoody LoungerI’m not sure that I’ve understood the question, but something like
=if(and(isblank(A1),isblank(B1), "", SUM($G$3:G68)-SUM($F$3:F68))
will give a blank cell unless one or other of A1 and B1 is nonempty
Ian.
-
WSIanSaunders
AskWoody LoungerIf you use Excel dates, then the x axis values are in days. Your serial numbers are in months. The number of days per month varies, so there isn’t a simple way to get from one to the other.
Ian.
![]() |
Patch reliability is unclear. Unless you have an immediate, pressing need to install a specific patch, don't do it. |
SIGN IN | Not a member? | REGISTER | PLUS MEMBERSHIP |

Plus Membership
Donations from Plus members keep this site going. You can identify the people who support AskWoody by the Plus badge on their avatars.
AskWoody Plus members not only get access to all of the contents of this site -- including Susan Bradley's frequently updated Patch Watch listing -- they also receive weekly AskWoody Plus Newsletters (formerly Windows Secrets Newsletter) and AskWoody Plus Alerts, emails when there are important breaking developments.
Get Plus!
Welcome to our unique respite from the madness.
It's easy to post questions about Windows 11, Windows 10, Win8.1, Win7, Surface, Office, or browse through our Forums. Post anonymously or register for greater privileges. Keep it civil, please: Decorous Lounge rules strictly enforced. Questions? Contact Customer Support.
Search Newsletters
Search Forums
View the Forum
Search for Topics
Recent Topics
-
Blocking Search (on task bar) from going to web
by
HenryW
2 hours, 17 minutes ago -
Windows 10: Microsoft 365 Apps will be supported up to Oct. 10 2028
by
Alex5723
7 hours, 24 minutes ago -
Add or Remove “Ask Copilot” Context Menu in Windows 11 and 10
by
Alex5723
7 hours, 30 minutes ago -
regarding april update and may update
by
heybengbeng
9 hours ago -
MS Passkey
by
pmruzicka
5 hours, 4 minutes ago -
Can’t make Opera my default browser
by
bmeacham
16 hours, 40 minutes ago -
*Some settings are managed by your organization
by
rlowe44
3 hours, 23 minutes ago -
Formatting of “Forward”ed e-mails
by
Scott Mills
15 hours, 34 minutes ago -
SmartSwitch PC Updates will only be supported through the MS Store Going Forward
by
PL1
1 day, 11 hours ago -
CISA warns of hackers targeting critical oil infrastructure
by
Nibbled To Death By Ducks
1 day, 20 hours ago -
AI slop
by
Susan Bradley
10 hours, 22 minutes ago -
Chrome : Using AI with Enhanced Protection mode
by
Alex5723
1 day, 21 hours ago -
Two blank icons
by
CR2
9 hours, 17 minutes ago -
Documents, Pictures, Desktop on OneDrive in Windows 11
by
ThePhoenix
2 days, 6 hours ago -
End of 10
by
Alex5723
2 days, 9 hours ago -
Single account cannot access printer’s automatic duplex functionality
by
Bruce
1 day, 7 hours ago -
test post
by
gtd12345
2 days, 15 hours ago -
Privacy and the Real ID
by
Susan Bradley
2 days, 5 hours ago -
MS-DEFCON 2: Deferring that upgrade
by
Susan Bradley
7 hours, 36 minutes ago -
Cant log on to oldergeeks.Com
by
WSJonharnew
2 days, 19 hours ago -
Upgrading from Win 10
by
WSjcgc50
1 day, 7 hours ago -
USB webcam / microphone missing after KB5050009 update
by
WSlloydkuhnle
1 day, 10 hours ago -
TeleMessage, a modified Signal clone used by US government has been hacked
by
Alex5723
3 days, 11 hours ago -
The story of Windows Longhorn
by
Cybertooth
2 days, 22 hours ago -
Red x next to folder on OneDrive iPadOS
by
dmt_3904
3 days, 13 hours ago -
Are manuals extinct?
by
Susan Bradley
13 hours, 29 minutes ago -
Canonical ditching Sudo for Rust Sudo -rs starting with Ubuntu
by
Alex5723
3 days, 22 hours ago -
Network Issue
by
Casey H
3 days, 9 hours ago -
Fedora Linux is now an official WSL distro
by
Alex5723
4 days, 10 hours ago -
May 2025 Office non-Security updates
by
PKCano
4 days, 10 hours ago
Recent blog posts
Key Links
Want to Advertise in the free newsletter? How about a gift subscription in honor of a birthday? Send an email to sb@askwoody.com to ask how.
Mastodon profile for DefConPatch
Mastodon profile for AskWoody
Home • About • FAQ • Posts & Privacy • Forums • My Account
Register • Free Newsletter • Plus Membership • Gift Certificates • MS-DEFCON Alerts
Copyright ©2004-2025 by AskWoody Tech LLC. All Rights Reserved.