-
WSBodders
AskWoody LoungerNiven
One way around this might be to have a separate temporary import table where all fields are defined as Text 255, Required=No, Indexed=No. This table would have no indexes, and would be cleared down prior to each import.
You would then be able to check this table for possible data errors after running the append query and before moving the data to the main table. This should avoid most errors.
Nick
-
WSBodders
AskWoody LoungerYou are missing a second End If (it’s clearer with indenting):
If ID_Name.Value = True Then
BUSINESS_UNIT.Enabled = False
Else
If BUSINESS_UNIT.Value = True Then
ID_Name.Enabled = False
End If
End IfNick
-
WSBodders
AskWoody LoungerHans
That is exactly what I was looking for to use in another worksheet. Your knowledge is, as usual, spot on.
Thanks
Nick
-
WSBodders
AskWoody LoungerSteve
I would just offer a word of caution on this – the formula works fine so long as the day of the lease start date is not near the end of the month. If it is on say the 30th or 31st of the month you may get unexpected results.
For example using the formula =DATE(YEAR(A1),MONTH(A1)+B1,DAY(A1)) where A1 is Jan 30th, and B1 is 1 gives the result of March 2nd. This may not be what you wanted.
I’m not sure of the best way to get round this if you need to.
Nick
-
WSBodders
AskWoody LoungerOctober 25, 2007 at 10:59 am in reply to: Setting columns in Graph to specific colours (Access 2003) #1080952Pat
I have recently had to do something similar with Excel charts. I set up an array which is populated according to how many colours(intSeriesCount) are needed to be shown
ReDim agintSeriesColour(intSeriesCount)
Select Case intSeriesCount
Case 1
agintSeriesColour(0) = 17 ‘Bright green
Case 2
agintSeriesColour(0) = 17 ‘Bright green
agintSeriesColour(1) = 18 ‘Yellow
Case 3
agintSeriesColour(0) = 19 ‘Dark green
agintSeriesColour(1) = 17 ‘Bright green
agintSeriesColour(2) = 18 ‘Yellow
Case 4
agintSeriesColour(0) = 19 ‘Dark green
agintSeriesColour(1) = 17 ‘Bright green
agintSeriesColour(2) = 18 ‘Yellow
agintSeriesColour(3) = 20 ‘Light Orange
…
End SelectThe chart has its colours set as follows :
For intCount = 1 To XLcht.SeriesCollection.Count
XLcht.SeriesCollection(intCount).Interior.ColorIndex = agintSeriesColour(intCount – 1)
NextYou can set the min/max values of axes as follows :
.Axes(xlValue, xlPrimary).MaximumScale = sglMaxLost
.Axes(xlValue, xlPrimary).MinimumScale = 0HTH
Nick
-
WSBodders
AskWoody LoungerHans
Thanks for that – I will check up with my colleague on that.
Nick
-
WSBodders
AskWoody LoungerHans
As always you are completely spot on – this fixed the problem in an instant.
The reason I was using code was because I wanted to set the background colour to one that was not on the palette (a shade of light blue). I don’t know of any other way of doing this except in code.
Thanks again
Nick
-
WSBodders
AskWoody LoungerKobus
In Excel it depends what type of toolbars you have. Shortcut toolbars can ONLY be created programmatically (I think), unlike in Access.
My suggestion would be to copy the workbooks containing the toolbars & macros elsewhere (on your network or a USB pen drive) and then copy them back when your PC has been reformatted.
Nick
-
WSBodders
AskWoody LoungerGraeme
Without knowing more details of your setup, it’s difficult to say exactly which would be the best way forward. If the users are getting into SQL Server via your userID, then you could create the table to store the data (including the column UserID), create a view on that table, and then create a sproc with a parameter of UserID to select from the view.
Nick
-
WSBodders
AskWoody LoungerGraeme
A suggestion – depending on the amount of data you have for each user, you could create a permanent SQL Server table to store all the user data with a column UserID. You could then have a view on this table, and a sproc to call it with a parameter of UserID, so that each user would only see their own data.
HTH
Nick
-
WSBodders
AskWoody LoungerYou could use some VBA code like this (not complete) to create the CSV file where rng is the range of cells to be written out:
strDelimiter = “,”
‘Create a file system object and use it to create a new
‘text file.
Set fso = New FileSystemObject
Set txs = fso.CreateTextFile(strFileName, True)‘This loop is for looping from the top of the sheet to the bottom
For lngRow = 1 To rng.Rows.Count
For lngCol = 1 To rng.Columns.Count
txs.Write Chr(34) & rng.Cells(lngRow, lngCol) & Chr(34) & strDelimiter
Next lngCol
txs.Write vbCr
Next lngRowtxs.Close
Depending on the location you could have some code to change strDelimiter accordingly.
Nick
-
WSBodders
AskWoody LoungerMy fault – I was looking in the wrong place in the code.
I had coded : InStr(1, rngFound.Formula, strSearchText) & it should have been : InStr(1, rngFound.Formula, strSearchText, vbTextCompare)
It now works properly.
Thanks for your help
Nick
-
WSBodders
AskWoody LoungerHans
This is the main part of the code :
For Each sht In wkb.Worksheets
Application.StatusBar = “Processing Workbook : ” & wkb.Name & ” Worksheet : ” & sht.Name
Set rngLastCell = LastCell(sht)
If Not (rngLastCell Is Nothing) Then
With sht
‘
‘———————————————————–
‘Find all references to search text
‘THIS IS WHERE MATCH CASE DOES NOT SEEM TO WORK
‘———————————————————–
Set rngSearch = .Range(.Cells(1, 1), .Cells(rngLastCell.Row, rngLastCell.Column))
If blnSearchValues Then
Set rngFound = rngSearch.Find(what:=strSearchText, LookIn:=xlValues, MatchCase:=blnMatchCase)
Else
Set rngFound = rngSearch.Find(what:=strSearchText, LookIn:=xlFormulas, MatchCase:=blnMatchCase)
End If
If rngFound Is Nothing Then
‘do nothing
Else
‘Code to store references deleted here
End If
End If
End With
End If
Next -
WSBodders
AskWoody LoungerHans
The search code is usually in a separate workbook but I have added the module to the samplefind.xls. The “GBP” to find is in column W.
Thanks
Nick
-
WSBodders
AskWoody LoungerMarch 8, 2007 at 12:24 pm in reply to: Right-click menu running code twice (Excel 2003 SP1) #1055243I’ve just found out why I should have been using functions – it is because they do not show up when the user clicks Tools/Macros/Macros.. whereas the subs do, and that is not desirable for us.
![]() |
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
-
Who knows what?
by
Will Fastie
1 hour, 6 minutes ago -
My top ten underappreciated features in Office
by
Peter Deegan
1 hour, 15 minutes ago -
WAU Manager — It’s your computer, you are in charge!
by
Deanna McElveen
4 hours ago -
Misbehaving devices
by
Susan Bradley
4 hours, 2 minutes ago -
.NET 8.0 Desktop Runtime (v8.0.16) – Windows x86 Installer
by
WSmeyerbos
21 hours, 39 minutes ago -
Neowin poll : What do you plan to do on Windows 10 EOS
by
Alex5723
17 hours, 23 minutes ago -
May 31, 2025—KB5062170 (OS Builds 22621.5415 and 22631.5415 Out-of-band
by
Alex5723
20 hours, 13 minutes ago -
Discover the Best AI Tools for Everything
by
Alex5723
20 hours, 22 minutes ago -
Edge Seems To Be Gaining Weight
by
bbearren
10 hours, 31 minutes ago -
Rufus is available from the MSFT Store
by
PL1
18 hours, 33 minutes ago -
Microsoft : Ending USB-C® Port Confusion
by
Alex5723
1 day, 21 hours ago -
KB5061768 update for Intel vPro processor
by
drmark
1 day, 3 hours ago -
Outlook 365 classic has exhausted all shared resources
by
drmark
1 hour, 3 minutes ago -
My Simple Word 2010 Macro Is Not Working
by
mbennett555
1 day, 17 hours ago -
Office gets current release
by
Susan Bradley
1 day, 19 hours ago -
FBI: Still Using One of These Old Routers? It’s Vulnerable to Hackers
by
Alex5723
3 days, 9 hours ago -
Windows AI Local Only no NPU required!
by
RetiredGeek
2 days, 18 hours ago -
Stop the OneDrive defaults
by
CWBillow
3 days, 10 hours ago -
Windows 11 Insider Preview build 27868 released to Canary
by
joep517
3 days, 20 hours ago -
X Suspends Encrypted DMs
by
Alex5723
3 days, 22 hours ago -
WSJ : My Robot and Me AI generated movie
by
Alex5723
3 days, 23 hours ago -
Botnet hacks 9,000+ ASUS routers to add persistent SSH backdoor
by
Alex5723
3 days, 23 hours ago -
OpenAI model sabotages shutdown code
by
Cybertooth
4 days ago -
Backup and access old e-mails after company e-mail address is terminated
by
M W Leijendekker
3 days, 12 hours ago -
Enabling Secureboot
by
ITguy
3 days, 19 hours ago -
Windows hosting exposes additional bugs
by
Susan Bradley
4 days, 8 hours ago -
No more rounded corners??
by
CWBillow
4 days, 4 hours ago -
Android 15 and IPV6
by
Win7and10
3 days, 17 hours ago -
KB5058405 might fail to install with recovery error 0xc0000098 in ACPI.sys
by
Susan Bradley
4 days, 20 hours ago -
T-Mobile’s T-Life App has a “Screen Recording Tool” Turned on
by
Alex5723
4 days, 23 hours ago
Recent blog posts
Key Links
S | M | T | W | T | F | S |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 |
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.