Add date to each sheet using range from another workbook

redspanna

Well-known Member
Joined
Jul 27, 2005
Messages
1,575
Office Version
  1. 365
Platform
  1. Windows
Hi all


My workbook named Monthly Report Template has a sheet named Info

I would like each sheet in my separate active workbook to have a date populated from the above workbook/sheet.

So for example...

each sheet in the active workbook would have F4 populated with the value of Info!C

eg..

Sheet1 cell ref F4 = Workbook - Monthly Report Template Sheet Info Range C2
Sheet2 cell ref F4 = Workbook - Monthly Report Template Sheet Info Range C3
Sheet3 cell ref F4 = Workbook - Monthly Report Template Sheet Info Range C4
and so on

hope this makes sense and thanks in advance
 

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.

redspanna

Well-known Member
Joined
Jul 27, 2005
Messages
1,575
Office Version
  1. 365
Platform
  1. Windows
this works for me...

Code:
Sub PopulateDates() 
    Dim wbReport As Workbook 
    Set wbReport = Workbooks("Monthly Report.xlsx") 
    i = 0 
    For Each ws In ActiveWorkbook.Sheets 
        ws.Range("F4").Value = wbReport.Sheets("INFO").Range("G2").Offset(i, 0).Value 
        i = i + 1 
    Next 
End Sub
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,164,157
Messages
5,835,713
Members
430,381
Latest member
tntcute

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top