-
WSBat17
AskWoody LoungerHighlight the block of cells you wish to sum and click on the Autosum icon. this will then add an sum() to the end of your block.
Peter
-
WSBat17
AskWoody Lounger
I think that you need to set the value to NA() rather than “”Peter
-
WSBat17
AskWoody LoungerThe Word document is a RTF file with a single table in it. It is a propper table not just a formatted list of texrt, with a Header row and aprrox 1500 rows of data.
It is generated as a report from a “Bought in” database that has no other output options.
I currently use the following code but is is unreliable.Set WordApp = CreateObject(“word.application”)
‘ Use WordApp to access Words objects
With WordApp
.Documents.Open FileName:=strReportPath
.ActiveDocument.Tables(1).Select
.Selection.Copy
End WithRange(“b4”).Select
‘ActiveSheet.Paste
SendKeys “^v”, True
‘ sends ctr-V to paste, as ActiveSheet.Paste pasted differently to pasting by hand
With WordApp
.ActiveDocument.Close
.Quit
End With
Set WordApp = Nothing ‘ clear the reference.It will work most of the time, but will occasionally paste the document back onitself instead of in Excell!
Not sure about using HTML but I will have a look, I am sure there is no output in that format from the DB but it might be more reliable to automate Word to do it than the copy/paste routine
Thanks
Peter
-
WSBat17
AskWoody LoungerI can copy and paste OK doing things by hand but I am setting up an automatic system, Click a button in Excel to import the data sort it and report.
It is the copy/paste in code that is causing the problem.
I was hoping that there would be a way of importing/linking to the table directly to avoid the copy/paste bitPeter
-
WSBat17
AskWoody LoungerI think this code should help you with your query.
You may need to hack the date format depending where you live ( It works in the UK)
Function funCompleteTime(dateIn As Date) As Date
Const intHourStart As Integer = 7
Const intHourEnd As Integer = 18
Const intTargetTime As Integer = 8Dim dblRemainingTime As Double
Dim intAddDays As Integer
Dim dateCheck As Date
Dim fDone As BooleanIf Hour(dateIn) > intHourEnd – intTargetTime Then
intAddDays = 1
Do Until fDone = True
dateCheck = dateIn + intAddDays
If WeekDay(dateCheck) = vbSaturday Then
intAddDays = intAddDays + 1
ElseIf WeekDay(dateCheck) = vbSunday Then
intAddDays = intAddDays + 1
ElseIf DLookup(“[dateHoliday]”, “tblHolidayList”, “[dateHoliday] = #” & Format(dateCheck, “dd/mm/yyyy”) & “#”) Then
intAddDays = intAddDays + 1
Else
fDone = True
End If
Loop
dblRemainingTime = intTargetTime – (intHourEnd – ((dateIn – Int(dateIn)) * 24))
funCompleteTime = Int(dateIn) + intAddDays + (intHourStart + dblRemainingTime) / 24
Else
funCompleteTime = dateIn + intTargetTime / 24
End If
End FunctionPeter
-
WSBat17
AskWoody LoungerJust tried it on my (A97)
Works fine if you import the link, not try to link to the linkHTH
-
WSBat17
AskWoody LoungerJanuary 25, 2002 at 7:50 am in reply to: NotInList event / add new record in a subform (97/SR-2) #566068and as a P.S. you can always save a macro as a module to get the code
Bat17
-
WSBat17
AskWoody LoungerUnless you want to store the details for printing out later, it is not so much a case of storing the value as having the query checking the values when it is run.
In the criteria field of the Query grid use the builder to get the value from the combo box on the form, some thing like
[Forms]![frmReportFilter]![cboLineName]HTH
Peter
![]() |
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
-
Updating Windows 10 to Windows 11: 23H2 or 24H2?
by
Still Anonymous
6 minutes ago -
How can I update “Explorer Patcher”
by
WSplanckster
12 minutes ago -
Check out the home page for Signal
by
CAS
1 hour, 2 minutes ago -
Windows 11 and Trial version of MS Office
by
Tex265
1 hour, 12 minutes ago -
Windows 11 Insider Preview build 26120.3585 (24H2) released to BETA
by
joep517
4 hours, 23 minutes ago -
Windows 11 Insider Preview build 26200.5510 released to DEV
by
joep517
4 hours, 26 minutes ago -
Windows 11 Insider Preview Build 26100.3624 (24H2) released to Release Preview
by
joep517
4 hours, 29 minutes ago -
Limits on User Names
by
CWBillow
1 hour, 12 minutes ago -
MS-DEFCON 4: Mixed bag for March
by
Susan Bradley
16 minutes ago -
Non Apple Keyboards
by
pmcjr6142
18 hours, 9 minutes ago -
How to delete your 23andMe data – The Verge
by
AJNorth
6 hours, 9 minutes ago -
7 common myths about Windows 11 (Microsoft AD)
by
EyesOnWindows
1 hour, 56 minutes ago -
Error updating to Win11 0x8024a205
by
bmeacham
22 hours, 38 minutes ago -
default apps
by
chasfinn
22 hours, 20 minutes ago -
Will MS Works 4 work in MS Win 11?
by
MileHighFlyer
1 day, 6 hours ago -
Adding links to text in Word 2000
by
sgeneris
3 hours, 26 minutes ago -
FBI warnings are true—fake file converters do push malware
by
Nibbled To Death By Ducks
23 hours, 53 minutes ago -
Classic and Extended Control Panel — no need to say goodbye
by
Deanna McElveen
2 hours, 8 minutes ago -
Things you can do in 2025 that you couldn’t do in 2024
by
Max Stul Oppenheimer
1 day, 11 hours ago -
Revisiting Windows 11’s File Explorer
by
Will Fastie
19 hours, 44 minutes ago -
Planning ahead for migration
by
Susan Bradley
14 hours, 43 minutes ago -
Yahoo mail getting ornery
by
Tom in Az
22 hours, 29 minutes ago -
Is Spectrum discontinuing email service?
by
Peobody
1 day, 2 hours ago -
Practice what you preach! A cautionary tale.
by
RetiredGeek
22 hours, 32 minutes ago -
Looking for Microsoft Defender Manuals/Tutorial
by
blueboy714
1 day, 2 hours ago -
Win 11 24H2 Home or Pro?
by
CWBillow
23 hours, 15 minutes ago -
Bipartisan Effort to Sunset the ‘26 Words That Created the Internet’..
by
Alex5723
3 days, 9 hours ago -
Outlook new and edge do not load
by
cHJARLES a pECKHAM
3 days, 21 hours ago -
Problem using exfat drives for backup
by
Danmc
3 days, 21 hours ago -
I hate that AI is on every computer we have!
by
1bumthumb
2 days, 23 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.