+ Reply to Thread
Results 1 to 8 of 8

copy and paste cells according to a calendar

Hybrid View

  1. #1
    Registered User
    Join Date
    03-30-2017
    Location
    TURKEY
    MS-Off Ver
    WİN10
    Posts
    4

    copy and paste cells according to a calendar

    I want to paste some numbers (as a template) into some other cells in the same row according to a calendar. here is the example.
    I mean that when I click the button, the numbers under the template column will be pasted into the cells under the dates. but the dates are changeable.
    Attached Files Attached Files

  2. #2
    Forum Guru Sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2019 | 2021
    Posts
    14,958

    Re: copy and paste cells according to a calendar

    Hi abozmaoglu

    Give this a try:
    Option Explicit
    
    Sub Distribute()
    Dim lRow As Long
    Dim c As Range
    Dim d As Integer, n As Integer, i As Integer
    Application.ScreenUpdating = False
    lRow = Sheets("Sayfa1").Cells(Rows.Count, "A").End(xlUp).Row
    For Each c In Range("A1:AI" & lRow)
        For d = 11 To 34
            For n = 3 To 9
                For i = 3 To lRow
                    If Format(Cells(2, d), "dddd") = Cells(2, n) Then
                        Cells(i, d) = Cells(i, n)
                    End If
                Next i
            Next n
        Next d
    Next c
    Application.ScreenUpdating = True
    End Sub
    Good Luck...
    I don't presume to know what I am doing, however, just like you, I too started somewhere...
    One-day, One-problem at a time!!!
    If you feel I have helped, please click on the [★ Add Reputation] to left of post window...
    Also....Add a comment if you like!!!!
    And remember...Mark Thread as Solved...
    Excel Forum Rocks!!!

  3. #3
    Registered User
    Join Date
    03-30-2017
    Location
    TURKEY
    MS-Off Ver
    WİN10
    Posts
    4

    Re: copy and paste cells according to a calendar

    thanks for reply but it didnt work.

  4. #4
    Forum Guru Sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2019 | 2021
    Posts
    14,958

    Re: copy and paste cells according to a calendar

    Works perfectly in my sample. Have a look at attached.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    03-30-2017
    Location
    TURKEY
    MS-Off Ver
    WİN10
    Posts
    4

    Re: copy and paste cells according to a calendar

    I checked but but it doesnt work. I will check another version of excel . thanks again

  6. #6
    Forum Guru Sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2019 | 2021
    Posts
    14,958

    Re: copy and paste cells according to a calendar

    That's strange...Gives following result.
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    03-30-2017
    Location
    TURKEY
    MS-Off Ver
    WİN10
    Posts
    4

    Re: copy and paste cells according to a calendar

    that's ok. I made a mistake. I had written the names of the days in my own language. when I changed it, it worked perfectly. thanks again....

  8. #8
    Forum Guru Sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2019 | 2021
    Posts
    14,958

    Re: copy and paste cells according to a calendar

    Hi abozmaoglu

    So...Did the code work...if so, please mark thread as solved and add to rep...Thanks

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Copy Calendar Data and paste data amongst list of cells
    By kingsdime29x in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-29-2015, 03:40 PM
  2. Copy & paste in macro doesn't paste all cells
    By pltrapper in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-13-2013, 09:22 AM
  3. [SOLVED] VBA to Copy set data, paste into set cells, then copy more & set into cells related 2 date
    By galvinpaddy in forum Excel Programming / VBA / Macros
    Replies: 99
    Last Post: 02-01-2013, 08:43 AM
  4. Replies: 1
    Last Post: 01-16-2013, 05:36 AM
  5. Paste a range of Excel cells into a Outlook Calendar appointment
    By FROSTY4207 in forum Outlook Formatting & Functions
    Replies: 0
    Last Post: 08-28-2012, 01:20 AM
  6. Copy, paste, make calendar macro?
    By Maxis001 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-07-2012, 02:35 PM
  7. Copy and paste non consecutive cells and paste consecutively in another workbook
    By macquhele in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-12-2011, 02:36 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1