#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 43
Default automation

I created payslips in excel which totalled to more than 50 sheets, each
employees pay slip is in one sheet. Now every month I want to change payslip
date and payment period dates in each sheet. what is the easiest way to do
this work? can this work be recorded in macro and be done by a click of a
button?
--
Life isa journey not a destination
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,533
Default automation

Hi

Why not just enter new dates in Sheet1 and then in other sheets use a
formula to get the dates from sheet1 like this:

=Sheet1!A1

To insert formulas in all 49 sheets in one step, right click on a sheet tab,
with any sheet but sheet1 active and 'Select all sheets' now hold down CTRL
key and click on sheet 1 to unselect it, now you can write the formulas in
one sheet and they are placed in all selected sheets.

If you really want it, it can be done by a macro, but then we need a bit
more info, like cells to change, shall it be changed in all sheets or is
there sheet(s) to be excluded.

Regards,
Per

"Sherees" skrev i meddelelsen
...
I created payslips in excel which totalled to more than 50 sheets, each
employees pay slip is in one sheet. Now every month I want to change
payslip
date and payment period dates in each sheet. what is the easiest way to do
this work? can this work be recorded in macro and be done by a click of a
button?
--
Life isa journey not a destination


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,819
Default automation

Select All Sheets and then change the Cell containing the dates


Sherees wrote:

I created payslips in excel which totalled to more than 50 sheets, each
employees pay slip is in one sheet. Now every month I want to change payslip
date and payment period dates in each sheet. what is the easiest way to do
this work? can this work be recorded in macro and be done by a click of a
button?


  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 43
Default automation

I dont know macro at all, so pls educate me as a beginner--
say for eg. i nedd to change the cell D6,D7&E7 in all the sheets what is to
be done in macro? what is to be done if i want to exclude some sheets from
the change? Please write both seperately and elaborately because i am totally
new to use macro. meanwhile let me try what u have suggested. And let me ask
which would be the easiest way (time saving) the one u suggested in this
letter or setting the macro?
--
Life isa journey not a destination


"Per Jessen" wrote:

Hi

Why not just enter new dates in Sheet1 and then in other sheets use a
formula to get the dates from sheet1 like this:

=Sheet1!A1

To insert formulas in all 49 sheets in one step, right click on a sheet tab,
with any sheet but sheet1 active and 'Select all sheets' now hold down CTRL
key and click on sheet 1 to unselect it, now you can write the formulas in
one sheet and they are placed in all selected sheets.

If you really want it, it can be done by a macro, but then we need a bit
more info, like cells to change, shall it be changed in all sheets or is
there sheet(s) to be excluded.

Regards,
Per

"Sherees" skrev i meddelelsen
...
I created payslips in excel which totalled to more than 50 sheets, each
employees pay slip is in one sheet. Now every month I want to change
payslip
date and payment period dates in each sheet. what is the easiest way to do
this work? can this work be recorded in macro and be done by a click of a
button?
--
Life isa journey not a destination


.

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,533
Default automation

Lets take the last question first, I would prefer the formula solution, as
the date change in all sheets once a date is entered, just rember that the
date can only be changed in 'Sheet1' else your formula will be overwritten,
and no date valus change in other sheets.
Once the macro is working as desired, you do not have to worry about
overwriting formulas.

To insert the macro, open the VBA editor (ALT+F11) Insert Module Paste
the macro into the code sheet and run it.

The macro will ask for the three dates to be changed, and loop through all
sheets excluding the sheet named 'NotThisSheet' and change the dates.

Sub ReplaceDates()
Dim pSlip As Date
Dim StartPeriod As Date
Dim EndPeriod As Date

pSlip = InputBox("Enter Payslip date", "Change Dates")
StartPeriod = InputBox("Enter Payment Period Start", "Change Dates")
EndPeriod = InputBox("Enter Payment Period End", "Change Dates")

For Each sh In ThisWorkbook.Sheets
If sh.Name < "NotThisSheet" and sh.Name <"ExcludeThisSheet" Then
'Remove if no sheets are to be excluded
With sh
.Range("D6") = pSlip
.Range("D7") = StartPeriod
.Range("E7") = EndPeriod
End With
End If 'Remove if no sheets are to be excluded
Next
End Sub

Regards,
Per

"Sherees" skrev i meddelelsen
...
I dont know macro at all, so pls educate me as a beginner--
say for eg. i nedd to change the cell D6,D7&E7 in all the sheets what is
to
be done in macro? what is to be done if i want to exclude some sheets from
the change? Please write both seperately and elaborately because i am
totally
new to use macro. meanwhile let me try what u have suggested. And let me
ask
which would be the easiest way (time saving) the one u suggested in this
letter or setting the macro?
--
Life isa journey not a destination


"Per Jessen" wrote:

Hi

Why not just enter new dates in Sheet1 and then in other sheets use a
formula to get the dates from sheet1 like this:

=Sheet1!A1

To insert formulas in all 49 sheets in one step, right click on a sheet
tab,
with any sheet but sheet1 active and 'Select all sheets' now hold down
CTRL
key and click on sheet 1 to unselect it, now you can write the formulas
in
one sheet and they are placed in all selected sheets.

If you really want it, it can be done by a macro, but then we need a bit
more info, like cells to change, shall it be changed in all sheets or is
there sheet(s) to be excluded.

Regards,
Per

"Sherees" skrev i meddelelsen
...
I created payslips in excel which totalled to more than 50 sheets, each
employees pay slip is in one sheet. Now every month I want to change
payslip
date and payment period dates in each sheet. what is the easiest way to
do
this work? can this work be recorded in macro and be done by a click of
a
button?
--
Life isa journey not a destination


.


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Automation Allenc Excel Worksheet Functions 5 January 13th 07 10:42 AM
Automation Error xlEnt Excel Discussion (Misc queries) 2 May 15th 06 11:37 PM
Automation?? Help in automation Excel Discussion (Misc queries) 1 April 12th 06 02:10 PM
automation Darius New Users to Excel 1 September 23rd 05 07:37 AM
Workbook automation shaneh Excel Discussion (Misc queries) 1 July 8th 05 09:06 PM


All times are GMT +1. The time now is 05:35 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"