-
WSpieter
AskWoody Loungerhi Jefferson, Musical1,
As Musical1 mentioned word 97 explicitly in his/her post, i didn’t provide the visible switch which is not available in word 97, but as an alternative i included the application.update=false and …=true which essentially achieves the same. to be complete, i list the corrected function below, together with a small sub to demonstrate the use of the function :
sub testfunction
if clipboardcontainstable then
msgbox “Table in Clipboard!”
else
msgbox “No Table!”
end if
end subfunction ClipboardContainsTable() as boolean
dim TableDocument as document
dim ScreenUpdate as boolean
screenupdate=application.screenupdating
application.screenupdating=false
set tabledocument=documents.add
with tabledocument
.content.paste
clipboardcontainstable=.tables.count>0
.close savechanges:=wddonotsavechanges
end with
application.screenupdating=screenupdate
end functionafter carefully rereading Musical1’s post, i found another way still to test if the cliboard contains a table, which involves reading the caption of the changed control; this would be much faster as it doesn’t involve pasting to a temporary document. i must say i’m not confident of the exact caption of the control, as i’m testing here in dutch, and the caption includes an & which points to the menu’s shortcut key. IIRC, it’s also p for the english version, so the control’s caption will start with the ampersand (&). here’s the modified function which can be used in exactly the same way:
function ClipboardContainsTable() as boolean
clipboardcontainstable= _
ucase(commandbars(“edit”).FindControl(id:=22).Caption) _
=”&PASTE CELL”
end functiongreetings,
-
WSpieter
AskWoody Loungerhi Musical1,
the dataobject will not allow you to make this distinction, maybe there’s an appropriate api functiun to test whether the clipboard contains a table or not, but i don’t know it.
you could however paste to a temporary document and then examine the contents of the document to see if the clipboard contains a table. this is feasable if the tables are not too big:function ClipboardContainsTable() as boolean
dim TableDocument as document
‘application.screenupdating=true
set tabledocument=documents.add
with tabledocument
.content.paste
clipboardcontainstable=.tables.count>0
.close savechanges:=wddonotsavechanges
end with
‘application.screenupdating=true
end functionalso try to play with the options.AutoFormatAsYouTypeApplyTables setting to avoid the column to be converted.
greetings,
-
WSpieter
AskWoody Loungerhi Awckie,
if you really want to do this in VBA, below you’ll find the sub. but you can achieve the same easily with the vlookup function (check excel’s online help).
Sub MakeList() Dim CurrentCell As Range Dim CorrespondingValue As String With ActiveSheet 'loop will stop at the first empty cell in column j 'if you want to loop to the last cell in j with data in, change '.Range("J1").End(xlDown) to '.Range("J65536").End(xlup) For Each CurrentCell In _ Range(.Range("J1"), .Range("J1").End(xlDown)) CorrespondingValue = "" Select Case CurrentCell.Text Case "K05A" CorrespondingValue = "JA" Case "KP60RA" CorrespondingValue = "JP" Case "27" CorrespondingValue = "J" 'add the other cases 'case "xx" 'correspondingvalue="y" 'case ... Case Else CorrespondingValue = "Look up manually" End Select 'comment the case else and the last corresp... line and 'decomment the following do-loop if you want 'the user to fill in an inputbox in case 'he has to do a manual lookup 'Do ' CorrespondingValue = _ ' InputBox("enter value for " & CurrentCell) 'Loop Until CorrespondingValue "" CurrentCell.Offset(0, 1) = CorrespondingValue Next End With End Sub
greetings, pieter.
-
WSpieter
AskWoody Loungerhi Awckie,
the code to find the last cell is exactly the same, it uses the end property of the range object with the xldown parameter (which is the same as pressing the end key and then cursor arrow down in the interface)
i also used a string variable to temporarily store the value that needs to be filled in in column K, and then issue only one statement (currentcell.offset(0,1)=correspondingvalue, whereas Sam does this in each case.
i did it this way as it would also optionally allow the inputbox to ask for a value in case the user had to look up manually, should you want to do so.
anyway, the differences are minor.hth, greetings, pieter.
ps. sorry for the lacking tabs in the code, this was my first post to the list.
![]() |
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
-
Has the Microsoft Account Sharing Problem Been Fixed?
by
jknauth
1 hour, 12 minutes ago -
W11 24H2 – Susan Bradley
by
G Pickerell
3 hours, 7 minutes ago -
7 tips to get the most out of Windows 11
by
Alex5723
1 hour, 8 minutes ago -
Using Office apps with non-Microsoft cloud services
by
Peter Deegan
7 hours, 16 minutes ago -
I installed Windows 11 24H2
by
Will Fastie
6 minutes ago -
NotifyIcons — Put that System tray to work!
by
Deanna McElveen
6 hours, 34 minutes ago -
Decisions to be made before moving to Windows 11
by
Susan Bradley
6 minutes ago -
Port of Seattle says ransomware breach impacts 90,000 people
by
Nibbled To Death By Ducks
14 hours, 49 minutes ago -
Looking for personal finance software with budgeting capabilities
by
cellsee6
16 hours, 11 minutes ago -
ATT/Yahoo Secure Mail Key
by
Lil88reb
1 day, 3 hours ago -
Devices with apps using sprotect.sys driver might stop responding
by
Alex5723
1 day, 7 hours ago -
Neowin – 20 times computers embarrassed themselves with public BSODs and goofups
by
EP
1 day, 16 hours ago -
Slow Down in Windows 10 performance after March 2025 updates ??
by
arbrich
18 hours, 42 minutes ago -
Mail from certain domains not delivered to my outlook.com address
by
pumphouse
1 day ago -
Is data that is in OneDrive also taking up space on my computer?
by
WShollis1818
1 day, 11 hours ago -
Nvidia just fixed an AMD Linux bug
by
Alex5723
3 days, 3 hours ago -
50 years and counting
by
Susan Bradley
1 hour, 26 minutes ago -
Fix Bluetooth Device Failed to Delete in Windows Settings
by
Drcard:))
4 hours, 15 minutes ago -
Licensing and pricing updates for on-premises server products coming July 2025
by
Alex5723
3 days, 14 hours ago -
Edge : Deprecating window.external.getHostEnvironmentValue()
by
Alex5723
3 days, 14 hours ago -
Rethinking Extension Data Consent: Clarity, Consistency, and Control
by
Alex5723
3 days, 14 hours ago -
OneNote and MS Word 365
by
CWBillow
3 days, 16 hours ago -
Ultimate Mac Buyers Guide 2025: Which Mac is Right For You?
by
Alex5723
3 days, 16 hours ago -
Intel Unison support ends on Windows 11 in June
by
Alex5723
3 days, 16 hours ago -
April 2025 — still issues with AMD + 24H2
by
Kevin Jones
1 day, 8 hours ago -
Windows 11 Insider Preview build 26200.5518 released to DEV
by
joep517
4 days, 4 hours ago -
Windows 11 Insider Preview build 26120.3671 (24H2) released to BETA
by
joep517
4 days, 4 hours ago -
Forcing(or trying to) save Local Documents to OneDrive
by
PateWilliam
4 days, 13 hours ago -
Hotpatch for Windows client now available (Enterprise)
by
Alex5723
4 days, 1 hour ago -
MS-DEFCON 2: Seven months and counting
by
Susan Bradley
3 days, 2 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.