-
WSwmmwall20
AskWoody LoungerThanks Hans and Legare.
I tried both sets of code and had better luck with Hans’. I only made one modification to the code and it worked flawlessly. Pasted in below for reference:
‘ BrowseFolder from Don Ceraso:
Public Function BrowseFolder(Optional Title As String = “Select a Folder”, _
Optional RootFolder As Variant) As String
On Error Resume Next
BrowseFolder = CreateObject(“Shell.Application”).BrowseForFolder _
(0, Title, 0, RootFolder).Items.Item.Path
End FunctionSub ProcessWorkbooks()
Dim strFolder As String
Dim strFile As String
Dim wbk As WorkbookOn Error GoTo ErrHandler
strFolder = BrowseFolder
If strFolder = “” Then Exit SubIf Not Right(strFolder, 1) = “” Then
strFolder = strFolder & “”
End IfstrFile = Dir(strFolder & “*.xls”)
Do While Not strFile = “”
Set wbk = Workbooks.Open(strFolder & strFile)
wbk.ActiveSheet.Name = “data”
wbk.Close SaveChanges:=True
strFile = Dir
LoopExitHandler:
Set wbk = Nothing
Exit SubErrHandler:
MsgBox Err.Description, vbExclamation
Resume ExitHandler -
WSwmmwall20
AskWoody LoungerThanks Steve.
While this wasn’t the formula that I remembered it works even better.
-
WSwmmwall20
AskWoody LoungerThanks Jan.
This solution was a bit involved as I had to perform the procedure for about 40 files. However, I am happy with the result.
Was this the only way that the corruption issue can be resolved?
I’m not exactly sure how the file got corrupted in the first place but suspect that, by copying back and forth to a memory stick and working on a different computer repeatedly may have resulted in the introduction of garbage into the files.
Thank you for your help.
-
WSwmmwall20
AskWoody LoungerThank you Hans and Legare.
I tried both of your responses and was able to work Legare’s code in a little easier. I will save both responses for future reference.
Thank you both again for your valuable assistance.
-
WSwmmwall20
AskWoody LoungerNovember 12, 2004 at 1:30 pm in reply to: Macro to paste into different workbook (Excel 2003) #899082Thanks so much John and Rudi.
I have code that does exactly what I needed as a result of your valuable input. I still need to tweak a few things (Unprotect the sheets in the destination workbook that I am modifying and add a prompt when I change the source of the links) but it works.
I am including the code in this thread for the benefit of other users who seek a similar solution.
Dim DWB As Workbook
Dim DestinationBook As String
Set CWB = ActiveWorkbook
DestinationBook = Application.GetOpenFilename(“All Excel Files,*.xls”)
Workbooks.Open DestinationBook
Set DWB = ActiveWorkbook
CWB.Activate
Sheets(“Inter-Branch Allocation”).Range(“A1216:BI1251”).Copy DWB.Sheets(“Inter-Branch Allocation”).Range(“A1216”)
Sheets(“Detailed Financials”).Range(“AA82:BT82”).Copy DWB.Sheets(“Detailed Financials”).Range(“AA82”)
Sheets(“Detailed Financials”).Range(“AA95:BT95”).Copy DWB.Sheets(“Detailed Financials”).Range(“AA95”)
Sheets(“Monthly Plan Summary”).Range(“Y29:BR29”).Copy DWB.Sheets(“Monthly Plan Summary”).Range(“Y29”) -
WSwmmwall20
AskWoody LoungerNovember 11, 2004 at 7:02 pm in reply to: Macro to paste into different workbook (Excel 2003) #898716Thanks Rudi.
I have incorporated most of your code but I am hitting a snag. Specifically, the line of code:
Sheets(“Inter-Branch Allocation”).Range(“A1216:BI1251”).Select
is getting flagged with a runtime error 1004 (Select method of Range class failed).
The entire code as I copied and modified from your post follows:
Dim CWB As Workbook
Dim DWB As Workbook
Set CWB = ActiveWorkbook
DestinationBook = Application.GetOpenFilename(“All Excel Files, *.xls”)
Workbooks.Open DestinationBook
Set DWB = ActiveWorkbook
CWB.Activate
Sheets(“Inter-Branch Allocation”).Range(“A1216:BI1251”).Select
Selection.Copy Destination = DWB.Sheets(“Inter-Branch Allocation”).Range(“A1216”)Thanks for your help.
-
WSwmmwall20
AskWoody LoungerNovember 11, 2004 at 7:02 pm in reply to: Macro to paste into different workbook (Excel 2003) #898717Thanks Rudi.
I have incorporated most of your code but I am hitting a snag. Specifically, the line of code:
Sheets(“Inter-Branch Allocation”).Range(“A1216:BI1251”).Select
is getting flagged with a runtime error 1004 (Select method of Range class failed).
The entire code as I copied and modified from your post follows:
Dim CWB As Workbook
Dim DWB As Workbook
Set CWB = ActiveWorkbook
DestinationBook = Application.GetOpenFilename(“All Excel Files, *.xls”)
Workbooks.Open DestinationBook
Set DWB = ActiveWorkbook
CWB.Activate
Sheets(“Inter-Branch Allocation”).Range(“A1216:BI1251”).Select
Selection.Copy Destination = DWB.Sheets(“Inter-Branch Allocation”).Range(“A1216”)Thanks for your help.
-
WSwmmwall20
AskWoody LoungerThe ASAP Utility is amazing. It works perfectly changing a block of cell formulas from relative to absolute (including multiple references within a formula). I am looking forward to checking out the other features.
Thanks Peter
-
WSwmmwall20
AskWoody LoungerThe ASAP Utility is amazing. It works perfectly changing a block of cell formulas from relative to absolute (including multiple references within a formula). I am looking forward to checking out the other features.
Thanks Peter
-
WSwmmwall20
AskWoody LoungerJuly 29, 2004 at 5:03 pm in reply to: Pasting Formulas into Different Workbooks (Excel 2003) #857449Thanks. I was hoping to make this as automated as possible since the formula will be copied into many cells and I didn’t want the users to have to go through that process. I believe that the best approach would be to copy the corrected section into the user’s file and use Edit Links to change the source from the fix file to the user’s file.
-
WSwmmwall20
AskWoody LoungerJuly 29, 2004 at 5:03 pm in reply to: Pasting Formulas into Different Workbooks (Excel 2003) #857450Thanks. I was hoping to make this as automated as possible since the formula will be copied into many cells and I didn’t want the users to have to go through that process. I believe that the best approach would be to copy the corrected section into the user’s file and use Edit Links to change the source from the fix file to the user’s file.
-
WSwmmwall20
AskWoody LoungerI just did a copy from one file and paste the macro to the other file. I did solve the problem. I deleted any links, then for the buttons I had to re-assign all macros. It worked, I just thought there might be a faster solution.
-
WSwmmwall20
AskWoody LoungerI just did a copy from one file and paste the macro to the other file. I did solve the problem. I deleted any links, then for the buttons I had to re-assign all macros. It worked, I just thought there might be a faster solution.
-
WSwmmwall20
AskWoody LoungerBoth subforms are subforms only to the main form. Both have the same link to the form. When I enter data I run a macro to update the forms. The first subform is refreshed, but the second subform does not refresh. Does this help. Here’s more, when I change the payroll in the first subform, and press the calculate button, a macro recalculates the premium. The total of all premiums is listed down in the second subform. The first subform shows the new calculated premium, but the bottom subform does not refresh the sum of all premiums. Thank you.
-
WSwmmwall20
AskWoody LoungerBoth subforms are subforms only to the main form. Both have the same link to the form. When I enter data I run a macro to update the forms. The first subform is refreshed, but the second subform does not refresh. Does this help. Here’s more, when I change the payroll in the first subform, and press the calculate button, a macro recalculates the premium. The total of all premiums is listed down in the second subform. The first subform shows the new calculated premium, but the bottom subform does not refresh the sum of all premiums. Thank you.
![]() |
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
-
CISA warns of hackers targeting critical oil infrastructure
by
Nibbled To Death By Ducks
4 hours, 33 minutes ago -
AI slop
by
Susan Bradley
3 hours, 44 minutes ago -
Chrome : Using AI with Enhanced Protection mode
by
Alex5723
5 hours, 50 minutes ago -
Two blank icons
by
CR2
12 hours, 19 minutes ago -
Documents, Pictures, Desktop on OneDrive in Windows 11
by
ThePhoenix
14 hours, 44 minutes ago -
End of 10
by
Alex5723
17 hours, 24 minutes ago -
End Of 10 : Move to Linux
by
Alex5723
17 hours, 53 minutes ago -
Single account cannot access printer’s automatic duplex functionality
by
Bruce
14 hours, 22 minutes ago -
test post
by
gtd12345
23 hours, 25 minutes ago -
Privacy and the Real ID
by
Susan Bradley
13 hours, 32 minutes ago -
MS-DEFCON 2: Deferring that upgrade
by
Susan Bradley
5 hours, 39 minutes ago -
Cant log on to oldergeeks.Com
by
WSJonharnew
1 day, 3 hours ago -
Upgrading from Win 10
by
WSjcgc50
5 hours, 8 minutes ago -
USB webcam / microphone missing after KB5050009 update
by
WSlloydkuhnle
22 hours, 52 minutes ago -
TeleMessage, a modified Signal clone used by US government has been hacked
by
Alex5723
1 day, 19 hours ago -
The story of Windows Longhorn
by
Cybertooth
1 day, 7 hours ago -
Red x next to folder on OneDrive iPadOS
by
dmt_3904
1 day, 21 hours ago -
Are manuals extinct?
by
Susan Bradley
8 hours, 52 minutes ago -
Canonical ditching Sudo for Rust Sudo -rs starting with Ubuntu
by
Alex5723
2 days, 6 hours ago -
Network Issue
by
Casey H
1 day, 17 hours ago -
Fedora Linux is now an official WSL distro
by
Alex5723
2 days, 18 hours ago -
May 2025 Office non-Security updates
by
PKCano
2 days, 18 hours ago -
Windows 10 filehistory including onedrive folder
by
Steve Bondy
2 days, 20 hours ago -
pages print on restart (Win 11 23H2)
by
cyraxote
1 day, 21 hours ago -
Windows 11 Insider Preview build 26200.5581 released to DEV
by
joep517
2 days, 23 hours ago -
Windows 11 Insider Preview build 26120.3950 (24H2) released to BETA
by
joep517
2 days, 23 hours ago -
Proton to drop prices after ruling against “Apple tax”
by
Cybertooth
3 days, 6 hours ago -
24H2 Installer – don’t see Option for non destructive install
by
JP
8 minutes ago -
Asking Again here (New User and Fast change only backups)
by
thymej
3 days, 17 hours ago -
How much I spent on the Mac mini
by
Will Fastie
1 day, 1 hour 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.