Forum Discussion

Garrett4523's avatar
Garrett4523
Copper Contributor
Jun 27, 2023

Need Help Coding Worksheet

Good afternoon,

 

I am trying to have a sheet pick up data from a certain cell from another sheet if the dates match for each sheet. The sheet I need the value from changes dates every day but the second sheet has a list of dates. 

 

The first two pictures are sheet one and the third picture is sheet two. I need if the date changes on sheet one it takes the value from sheet 1 shown in picture 2 and auto-populates the date for that value in sheet 2 shown in picture 3. 

  • leoperdia's avatar
    leoperdia
    Brass Contributor

     

    Hi Garrett4523 , This code should work

    Private Sub Worksheet1_Change(ByVal Target As Range)

     

        If Target.Row = 4 And Target.Column = 3 Then ' Row and column of the date in sheet 1

                         ActiveWorkbook.Worksheets("Worksheet_2").Range("[cell in worksheet 2]").Value =   ActiveSheet.Range("[cell in worksheet 1 which contain the value]").Value         

       End If

    End sub

     

    Regards

    https://www.upwork.com/freelancers/~01cf0fc8446b00f44c 

Resources