• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

VBA-Copy and paste a range of data into column of a chosen date

Michael Mares

New Member
I'm having trouble trying to figure out how to get the following procedure done through the use of a Macro. I have a range of data, lets call it G24:G36, that I would like the values pasted into the corresponding date on to a table that has a list dates listed in row 1. The date would be based on the date that is selected in cell D22.

I've seen similar posts that pasted data onto another sheet and in a different way but I just can't figure out how to apply it in this situation.

I attached a simplified version of what I'm trying to accomplish.

I've done research upon research and I am completely stuck. I appreciate any help ya'll can offer.

Thanks in advance!
 

Attachments

  • Sample1.xlsx
    55.8 KB · Views: 0
Hi Michael,

Why use vba when this could be resolved using excel function? See attached file for example.

Kind regards,
A!
 

Attachments

  • Sample1.xlsx
    62.2 KB · Views: 0
Hello! Thanks for your response!

I thought about using a similar formula but I my intent is to store the data and re-use the field for the next day. Using the formula approach, I would either have to type the data in anyways or do a paste as values. For what it's worth, I used the January date as an example.

Though it's a rather simple objective, it's something I would use for other purposes, several times a day.
 

Hi !

How to find date in row #1 :​
Code:
Sub Demo()
    With Sheet1
           D# = 2 + .[D22].Value2 - .Cells(2).Value2
        If D > 1 Then
            With .Cells(D)
                If IsDate(.Value) Then MsgBox .Address
            End With
        End If
    End With
End Sub
Do you like it ? So thanks to click on bottom right Like !​
 
Last edited:
Back
Top