Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 01-11-2024, 01:44 PM
jchess jchess is offline change every footer in a folder of workbooks Windows 11 change every footer in a folder of workbooks Office 2021
Novice
change every footer in a folder of workbooks
 
Join Date: Jan 2024
Posts: 3
jchess is on a distinguished road
Default change every footer in a folder of workbooks


Hello,

I'm a vba newb who knows just enough to be dangerous lol but i have like 2800 workbooks I need to change the right footer in to match a new form number. i keep finding stuff for word docs and don't know the code well enough to even record my own macro. Please help!!

Reply With Quote
  #2  
Old 01-11-2024, 04:33 PM
rollis13's Avatar
rollis13 rollis13 is offline change every footer in a folder of workbooks Windows 11 change every footer in a folder of workbooks Office 2016
Competent Performer
 
Join Date: Jan 2021
Location: Cordenons
Posts: 140
rollis13 will become famous soon enough
Default

At the bottom of this page there are several "Similar Threads" and most are 'Solved'. See if you can adapt one of those solutions for your needs.
__________________
Difficult is not to know but to share what you know (Han Fei Tzu reworked)
Reply With Quote
  #3  
Old 01-15-2024, 05:37 AM
jchess jchess is offline change every footer in a folder of workbooks Windows 11 change every footer in a folder of workbooks Office 2021
Novice
change every footer in a folder of workbooks
 
Join Date: Jan 2024
Posts: 3
jchess is on a distinguished road
Unhappy re rollis13

yeah, but they are all for word and i'm not smart enough to adapt them to excel. or I haven't learned how yet..
Reply With Quote
  #4  
Old 01-16-2024, 06:32 AM
rollis13's Avatar
rollis13 rollis13 is offline change every footer in a folder of workbooks Windows 11 change every footer in a folder of workbooks Office 2016
Competent Performer
 
Join Date: Jan 2021
Location: Cordenons
Posts: 140
rollis13 will become famous soon enough
Default

Oh, so you need a ready-made macro ... a forum is not the place for this .
Anyway, are the files all in one folder or even in subfolders ? so the path can be hard-coded in the macro.
Do the files contain a single sheet that has the right-footer to be update ? and does this sheet always have the same name ? elsewise you will have to loop through the sheets or skip some.
Does the actual right-footer contain a single data (old form number) or is it merged with other data ?
Do the files contain autorun macros ?
__________________
Difficult is not to know but to share what you know (Han Fei Tzu reworked)

Last edited by rollis13; 01-16-2024 at 10:34 AM.
Reply With Quote
  #5  
Old 01-17-2024, 09:58 AM
rollis13's Avatar
rollis13 rollis13 is offline change every footer in a folder of workbooks Windows 11 change every footer in a folder of workbooks Office 2016
Competent Performer
 
Join Date: Jan 2021
Location: Cordenons
Posts: 140
rollis13 will become famous soon enough
Default

This could be a basic macro that you can upgrade as needed. As it is the folder name is static (no subfolders) and will change the right-foot only on the first sheet of each file.
Code:
Option Explicit
Sub UpdateRightFooter()
    Dim wkb   As Workbook
    Dim sht   As Worksheet
    Dim myPath As String
    Dim strFile As String
    Dim cnt   As Long
    Application.ScreenUpdating = False
    Application.DisplayAlerts = False
    Application.EnableEvents = False
    Application.StatusBar = "Macro at work ... please wait"
    myPath = "F:\Prove\Test\"                     '<- adjust path as needed
    strFile = Dir(myPath & "*.xls*")              'for all sort of Excel files
    Do While Len(strFile) > 0
        Workbooks.Open (myPath & strFile)
        Set wkb = ActiveWorkbook
        Set sht = wkb.Worksheets(1)               'only for first sheet in file
        sht.PageSetup.RightFooter = "New Form Number" '<- adjust string as needed
        cnt = cnt + 1
        wkb.Close True
        strFile = Dir
    Loop
    Application.ScreenUpdating = True
    Application.DisplayAlerts = True
    Application.EnableEvents = True
    Application.StatusBar = Empty
    MsgBox "Done! for " & cnt & " files"
End Sub
__________________
Difficult is not to know but to share what you know (Han Fei Tzu reworked)
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
change every footer in a folder of workbooks Batch change the footer in multiple files with footer from another file kalagas Word VBA 9 02-10-2020 12:40 AM
I have 20 page word document with a footer. Can i change page # 10 footer only? aligahk06 Word 2 10-25-2017 04:53 AM
change every footer in a folder of workbooks Find & replace footer text in a folder of Word 2010 documents kennethc Word 3 03-28-2015 02:49 AM
change every footer in a folder of workbooks Word Macro - change date in footer for all files in a folder patidallas22 Word VBA 2 03-09-2012 08:14 AM
Loop through folder of workbooks and copy range to other workbook Snvlsfoal Excel Programming 3 07-29-2011 05:55 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 02:59 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft