-
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
![]() |
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
-
Can’t make Opera my default browser
by
bmeacham
2 hours, 13 minutes ago -
Do not Fall For This Purdentix Scam (Awaiting moderation)
by
elizabethkaur56
4 hours, 47 minutes ago -
*Some settings are managed by your organization
by
rlowe44
14 hours, 45 minutes ago -
Formatting of “Forward”ed e-mails
by
Scott Mills
16 hours, 59 minutes ago -
SmartSwitch PC Updates will only be supported through the MS Store Going Forward
by
PL1
17 hours, 24 minutes ago -
CISA warns of hackers targeting critical oil infrastructure
by
Nibbled To Death By Ducks
1 day, 2 hours ago -
AI slop
by
Susan Bradley
1 day, 1 hour ago -
Chrome : Using AI with Enhanced Protection mode
by
Alex5723
1 day, 3 hours ago -
Two blank icons
by
CR2
13 hours, 15 minutes ago -
Documents, Pictures, Desktop on OneDrive in Windows 11
by
ThePhoenix
1 day, 12 hours ago -
End of 10
by
Alex5723
1 day, 15 hours ago -
Single account cannot access printer’s automatic duplex functionality
by
Bruce
13 hours, 10 minutes ago -
test post
by
gtd12345
1 day, 21 hours ago -
Privacy and the Real ID
by
Susan Bradley
1 day, 11 hours ago -
MS-DEFCON 2: Deferring that upgrade
by
Susan Bradley
1 day, 3 hours ago -
Cant log on to oldergeeks.Com
by
WSJonharnew
2 days, 1 hour ago -
Upgrading from Win 10
by
WSjcgc50
13 hours, 20 minutes ago -
USB webcam / microphone missing after KB5050009 update
by
WSlloydkuhnle
16 hours, 54 minutes ago -
TeleMessage, a modified Signal clone used by US government has been hacked
by
Alex5723
2 days, 17 hours ago -
The story of Windows Longhorn
by
Cybertooth
2 days, 5 hours ago -
Red x next to folder on OneDrive iPadOS
by
dmt_3904
2 days, 19 hours ago -
Are manuals extinct?
by
Susan Bradley
4 hours, 52 minutes ago -
Canonical ditching Sudo for Rust Sudo -rs starting with Ubuntu
by
Alex5723
3 days, 4 hours ago -
Network Issue
by
Casey H
2 days, 15 hours ago -
Fedora Linux is now an official WSL distro
by
Alex5723
3 days, 16 hours ago -
May 2025 Office non-Security updates
by
PKCano
3 days, 16 hours ago -
Windows 10 filehistory including onedrive folder
by
Steve Bondy
3 days, 18 hours ago -
pages print on restart (Win 11 23H2)
by
cyraxote
2 days, 19 hours ago -
Windows 11 Insider Preview build 26200.5581 released to DEV
by
joep517
3 days, 20 hours ago -
Windows 11 Insider Preview build 26120.3950 (24H2) released to BETA
by
joep517
3 days, 20 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.