-
RetiredGeek
AskWoody_MVPThat last line is, unfortunately, not the case. Both parts of the And are evaluated regardless.
Sorry about that, I ran a test to confirm and you’re correct, I must have been thinking in another
language because I know I’ve programmed in languages that shortcut an AND if the left side is
false…more efficient.RG
-
RetiredGeek
AskWoody_MVPOne thing you can do is set it to open in the last database used as follows:
Click the Office Button
Select the Advanced Options button at bottom of window
Click on Advanced in the Left pane
Check the “Open las used database when Access starts” checkbox
OKRG
-
RetiredGeek
AskWoody_MVPI think it would depend on your situation, but you could also try filtering the data, or loading it into an array to read, before checking the values and colouring if appropriate.
There is also no point to the Is Nothing test in this line:Code:Loop While Not rngChroma Is Nothing And rngChroma.Address firstAddress
since you won’t be in the loop if the range is nothing, and the .address check would error if it were Nothing.
Am I missing something?
If you look at it like this: Loop While (Not (rngChroma Is Nothing)) and (rngChroma.Address firstAddress)
The left side of the AND is TRUE only when rngChroma is not empty
and FALSE when rngChroma is empty … remember the Not reverses things.Thus, the second half of the test is only evaluated if rngChroma has data which is what is the desired state.
RG
-
RetiredGeek
AskWoody_MVPWsRyan,
In the Property Sheet for the ComboBox control select the Event Tab.
In the On Change event click in the box to the right then click on the button
with the three periods and select Event Procedure.Code:Private Sub Combo0_Change() MsgBox "The ComboBox Value has Changed", vbOKOnly, "Combo Box Status:" '***Replace with our code to update date*** End Sub
I hope this points you in the right direction.
RG
-
RetiredGeek
AskWoody_MVPI ran a test and the function will work with one minor change: Define ZX as Object vs Collection.
Code:Option Explicit '*** Place this code in a Module --- not the form *** Public Function TestAreAnyTrue(ZX As Object) As Boolean Dim ctl As Control TestAreAnyTrue = False For Each ctl In ZX If ctl.Value = True Then TestAreAnyTrue = True End If Next ctl End Function
Calling code in form process/OK button:
Code:Private Sub cbProcess_Click() Debug.Print TestAreAnyTrue(UserForm1.frOne.Controls) Unload Me End Sub
Results of two runs…1. All false 2. One true
Code:False True
RG
-
RetiredGeek
AskWoody_MVPIt seems that you could save a lot of time by using what you have and creating a couple of lookup tables in a linked sheet/workbook.
Then replace the formulas in the contract with vlookup’s or hlookup’s depending on the table setup. Of course you would have to designate cells in the contract worksheet to identify things like county, tax status, etc. and use these references in the lookup formulas.
Also investigate the use of the indirect() function to grab the values in these designated cells and plant them in the lookup formulas.
I don’t have enough information from your example to know if the pricing is fixed or if you need a table for this based on the size of the property but this is also doable in the same fashion.I’ve included a file I used to teach a course. Check out the Data tab and the formula for Salary. Hopefully this will better explain what I tried to say above.
Good luck.
RG
-
RetiredGeek
AskWoody_MVPmbarron,
I couldn’t get your code to run as posted.
I made the following changes to get it to run.Code:Option Explicit Dim dClick Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean) If Intersect(Target, Range("e8")) Is Nothing Then Exit Sub Else Range("e7").Value = "EN " & Format(Val(Right(Range("e7").Text, 3) + 1), "000") dClick = True End If End Sub Private Sub Worksheet_Change(ByVal Target As Range) If Intersect(Target, Range("e8")) Is Nothing Then Exit Sub Else If dClick = True Then dClick = False Exit Sub Else Range("e7").Value = "EN " & Format(Val(Right(Range("e7").Text, 3) + 1), "000") End If End If End Sub
EDIT: Actually I went back and checked and the .Text isn’t need, but doesn’t hurt, but the .Value is.
RG
-
RetiredGeek
AskWoody_MVPIf you’re using Firefox try the FireFTP addin.
You can do it all in your browser.RG
-
RetiredGeek
AskWoody_MVPLastyear contains a RELATIVE reference and hence issuing Goto will have different results if your starting cell is different,
Duh! Sorry I missed this.
I’ve been playing with the file back and forth with Win XP-Excel 2003 (totally stable) and
Win 7-Excel 2007 (totally flaky). It’s got me totally stumped.Have you tried recreating the file from scratch and doing an initial save as .xls?
The file may have been corrupted when you did the conversion to .xls from .xlsx.
However, it is really strange that this only affects the way it works in 2007 and not 2003.
Go figure.RG
-
RetiredGeek
AskWoody_MVPDarsha,
It appears that the rng.rows.count will only parse the first range in a non-contiguous range set.
See the test code below:Code:Sub Test() Dim n As Long Dim Rng As Range Dim Cnt As Long Cnt = 0 Set Rng = Selection Debug.Print "Range: " & Rng.Address & " Rows: " & Rng.Rows.Count; "" For n = 1 To Rng.Rows.Count Cnt = Cnt + 1 'Debug.Print Rng.Cells(n, 1) Next n Debug.Print "n= : " & Cnt Debug.Print "Range: " & Rng.Address & " Rows: " & Rng.Rows.Count; "" End Sub ------------- OUTPUT ----------- Range: $A$1:$J$13,$M$22:$S$28 Rows: 13 n= : 13 Range: $A$1:$J$13,$M$22:$S$28 Rows: 13
RG
-
RetiredGeek
AskWoody_MVPBoobounder,
As a first shot I tried changing B5 to the following:
=CONCATENATE(“Inflation is “,TEXT(inflationRate,”##”),”%”)
No GO!
Next I listed all your names see below:
a_Hundred =100
Athens =Sheet1!$B$16:$J$16
Carthage =Sheet1!$B$15:$J$15
chosenCity =Sheet1!$B$4
ChosenVolume =Sheet1!$B$20:$J$20
Cities =Sheet1!$A$15:$A$19
cityCaption =Sheet1!$D$4
CityVolumes =Sheet1!A$15:A$19
inflationCaption =Sheet1!$D$5
inflationRate =Sheet1!$B$5
LastYear =Sheet1!IV:IV —- There is nothing in this column
priceCaption =Sheet1!$D$3
PriceScenario =Sheet1!$B$23:$J$23
PriceTable =Sheet1!$A$8:$B$10
Revenues =Sheet1!$B$25:$J$25
Rome =Sheet1!$B$19:$J$19
scenario =Sheet1!$B$3
Scenarios =Sheet1!$A$8:$A$10
Sparta =Sheet1!$B$17:$J$17
startYear =Sheet1!$B$12
Troy =Sheet1!$B$18:$J$18
Year =Sheet1!$B$12:$J$12LastYear is used in this formula:
B23:J23 =IF(Year=startYear,INDEX(PriceTable,scenario,2),LastYear*(1+inflationRate/a_Hundred))
If I use the F5 (GoTo) key to find: LastYear it highlights a different Column (very strange) — Still no data!
Note: Re doing the Paste List of names still shows LastYear as above?Seems like something has become seriously corrupted in this file.
RG
-
RetiredGeek
AskWoody_MVPT.
Just a thought, but did you do a straight paste or a paste values.
You may have copied a reference to the original file if you did a straight paste.R.G.
-
RetiredGeek
AskWoody_MVPGary,
Thanks, another trick for my bag!
RG
-
RetiredGeek
AskWoody_MVPThis seems like such a handy thing that I tried it in Word 2007 and I cannot get it to work. I changed names slightly, checked program Help which suggested including the full path to the macro, used the When and Name labels, did not include the lblMessage.Caption to make it simpler. No error message. The form displays and never closes.
Code:Sub TestTimedMessage() Application.OnTime When:=Now + TimeValue("00:00:05"), Name:="Normal.TestMacros.UnloadTimedDialog" frmTimedDialog.Show End Sub Sub UnloadTimedDialog() frmTimedDialog.Hide End Sub
What am I missing? Security is wide open.
Thanks, KimI tried it in Word and also ran into problems.
1. Make sure it’s in a module not ThisDocument
2. Change the form’s behavior to ShowModal = False (this makes it work!)I looked for the ShowModal property in the Object browser but could not find it so
you’ll have to set it when you design the form vs at runtime.RG
-
RetiredGeek
AskWoody_MVPI had a little trouble getting this to work…of course it was because I put the message display BEFORE the timer…duh!
Here’s my example code:
Code:Sub Testit() ufMessageBoard.lblMessage.Caption = "Testing timed message" 'Application.OnTime Now + TimeValue("00:00:03"), "UnloadMessageBoard" 'This works also Application.OnTime DateAdd("s", 3, Now), "UnloadMessageBoard" ufMessageBoard.Show End Sub Sub UnloadMessageBoard() ufMessageBoard.Hide End Sub
ufMessageBoard is just an Excel form with a single label field.
I used a label field because it won’t appear like a text field
which may be inviting the user to enter something.RG
![]() |
There are isolated problems with current patches, but they are well-known and documented on this site. |
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
-
Windows AI Local Only no NPU required!
by
RetiredGeek
4 hours, 2 minutes ago -
Stop the OneDrive defaults
by
CWBillow
7 hours, 4 minutes ago -
Windows 11 Insider Preview build 27868 released to Canary
by
joep517
9 hours, 30 minutes ago -
X Suspends Encrypted DMs
by
Alex5723
11 hours, 42 minutes ago -
WSJ : My Robot and Me AI generated movie
by
Alex5723
12 hours ago -
Botnet hacks 9,000+ ASUS routers to add persistent SSH backdoor
by
Alex5723
12 hours, 37 minutes ago -
OpenAI model sabotages shutdown code
by
Cybertooth
13 hours, 14 minutes ago -
Backup and access old e-mails after company e-mail address is terminated
by
M W Leijendekker
1 hour, 24 minutes ago -
Enabling Secureboot
by
ITguy
8 hours, 24 minutes ago -
Windows hosting exposes additional bugs
by
Susan Bradley
21 hours, 8 minutes ago -
No more rounded corners??
by
CWBillow
16 hours, 57 minutes ago -
Android 15 and IPV6
by
Win7and10
6 hours, 42 minutes ago -
KB5058405 might fail to install with recovery error 0xc0000098 in ACPI.sys
by
Susan Bradley
1 day, 9 hours ago -
T-Mobile’s T-Life App has a “Screen Recording Tool” Turned on
by
Alex5723
1 day, 12 hours ago -
Windows 11 Insider Preview Build 26100.4202 (24H2) released to Release Preview
by
joep517
1 day, 6 hours ago -
Windows Update orchestration platform to update all software
by
Alex5723
1 day, 19 hours ago -
May preview updates
by
Susan Bradley
1 day, 6 hours ago -
Microsoft releases KB5061977 Windows 11 24H2, Server 2025 emergency out of band
by
Alex5723
22 hours, 29 minutes ago -
Just got this pop-up page while browsing
by
Alex5723
1 day, 11 hours ago -
KB5058379 / KB 5061768 Failures
by
crown
1 day, 8 hours ago -
Windows 10 23H2 Good to Update to ?
by
jkitc
10 hours, 57 minutes ago -
At last – installation of 24H2
by
Botswana12
2 days, 11 hours ago -
MS-DEFCON 4: As good as it gets
by
Susan Bradley
7 hours, 44 minutes ago -
RyTuneX optimize Windows 10/11 tool
by
Alex5723
2 days, 23 hours ago -
Can I just update from Win11 22H2 to 23H2?
by
Dave Easley
21 hours, 40 minutes ago -
Limited account permission error related to Windows Update
by
gtd12345
3 days, 12 hours ago -
Another test post
by
gtd12345
3 days, 12 hours ago -
Connect to someone else computer
by
wadeer
3 days, 7 hours ago -
Limit on User names?
by
CWBillow
3 days, 10 hours ago -
Choose the right apps for traveling
by
Peter Deegan
3 days 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.