Fill cells with data based on dates?

tezza

Active Member
Joined
Sep 10, 2006
Messages
377
Office Version
  1. 2016
  2. 2010
Platform
  1. Windows
  2. Web
Hi All,

Hope you can help.

I've created a dynamic calendar but would like it to auto populate based on the dates and initials below it (see image of manually entered data for example purpose).

What is the best way to achieve this please?

Below is the link to the sheet that is in google drive which is view only to keep the original data in place but you should be able to copy it:
Dynamic Calendar

dynamic calendar image.jpg


Thank you.
Terry
 
Did you put the code in a standard module, rather than a sheet or ThisWorkbook module?
Also did you save the file as an xlsm file?
 
Upvote 0

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
I'm not good with VBA so I think so........

Saved as XLSM and now showing blank without errors also removing borders

Blank.jpg
 
Upvote 0
The code is in a sheet module, it needs to go in a standard module.
In the VB Editor click on insert, Module & paste the code in there. Also remove it from it's current location.
 
Upvote 0
Scrap that, I entered the wrong year lol, it's working fine now :biggrin:,.

Thank you very much.
 
Upvote 0
Glad it's working & thanks for the feedback.
 
Upvote 0
Glad it's working & thanks for the feedback.
I just wanted to share an update and to thank you once again :)

This now reads the data from below the calendar then auto populates a wall chart and each individual month separated into their own tabs that fit nicely onto an A4 sheet each for easy viewing.
Screenshot 2021-11-10 135709.jpg
Screenshot 2021-11-10 135642.jpg
Screenshot 2021-11-10 135619.jpg
 
Upvote 0
Glad it's working & thanks for the feedback.
Hi again,

This has been implemented and work are really happy with the result, they've ask if the date/Notes column can be sorted/filtered but as the cells are merged it failed, so I've cleared the merges and centred across selection instead but now all the dynamic stuff has gone, can you help once again please.

Start Date is Col B
End Date is Col D
Notes is Col F

Kind regards
 
Upvote 0
Ok, how about
VBA Code:
Function tezza(Dcl As Range, DRng As Range) As String
   Dim Cl As Range
   
   For Each Cl In DRng.Columns(1).Cells
      If Dcl.Value >= Cl.Value And Dcl.Value <= Cl.Offset(, 2).Value Then
         tezza = tezza & "," & Cl.Offset(, 4).Value
      End If
   Next Cl
   tezza = Mid(tezza, 2)
End Function
 
Upvote 0
Ok, how about
VBA Code:
Function tezza(Dcl As Range, DRng As Range) As String
   Dim Cl As Range
  
   For Each Cl In DRng.Columns(1).Cells
      If Dcl.Value >= Cl.Value And Dcl.Value <= Cl.Offset(, 2).Value Then
         tezza = tezza & "," & Cl.Offset(, 4).Value
      End If
   Next Cl
   tezza = Mid(tezza, 2)
End Function
That did it, thank you. I tried changing the values myself but couldn't work out what was happening to change the right ones.

You're a star :)
 
Upvote 0
Glad to help & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,216,526
Messages
6,131,187
Members
449,631
Latest member
mehboobahmad

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
Back
Top