Results 1 to 3 of 3

Automatically search for certain entries and copy them to certain places

Threaded View

  1. #1
    Registered User
    Join Date
    03-05-2015
    Location
    Austria
    MS-Off Ver
    2007
    Posts
    3

    Automatically search for certain entries and copy them to certain places

    Hello,

    thanks for such an awesome board!
    I have the following problem and hopefully you can help me to solve it via VBA. I have a list of different tasks which have to be done on different days all over the year.
    So there a table 2 with all the tasks and the month and day it has to be done (january = 1, feb. = 2, ... and a second column with "day two, day 4,...").
    I havbe a table 1 as well. At this tabel you see the whole Month, like a calender.

    Is it possible to automatically sort and copy the entries from table 2 to table 1?

    I already can copy only certain entries (for example, only entries for january), but how can I copy them to the right day of the week?

    'The macro should copy the entries
    Sub copy_sort()
    
    Dim Zeile As Long
    Dim ZeileMax As Long
    Dim i As Long
    
    With Tabelle2
    ZeileMax = .UsedRange.Rows.Count
    n = 1
    
    For Zeile = 2 To ZeileMax
    
    'at the moment only for january(in "F" should be 1 or x, because that are the tasks for january)
    If .Cells(Zeile, 6).Value = "x" Or .Cells(Zeile, 6).Value = "1" Then
    
    'just for testing purposes, the data is copied to table 3. in the final draft it should be copied to the first one
    .Rows(Zeile).Copy Destination:=Tabelle3.Rows(n)
    n = n + 1
    
    
    End If
    Next Zeile
    End With
    
    
    End Sub
    So how can I do it? I know i need a "If .Cells().Value = ..." same as the day i want it copy to, then copy. But I can't figure out how to do it for all days and and take the ones i need and how to copy them to the right place /day of the month.

    Because the whole task is a little bit confusing, I added an example file!

    I hope you can help me, thank you very mich!
    Cheers
    Attached Files Attached Files

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Limiting Validation entries to 2 places after a decimal
    By Tim in forum Excel General
    Replies: 12
    Last Post: 01-27-2016, 03:18 PM
  2. Replies: 3
    Last Post: 03-17-2014, 08:05 AM
  3. Replies: 3
    Last Post: 07-10-2013, 01:39 PM
  4. Replies: 1
    Last Post: 02-01-2013, 03:38 PM
  5. Automatically copy entries from one worksheet to another without double entry
    By DanielLGroy in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 03-19-2008, 09:45 AM

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