+ Reply to Thread
Results 1 to 36 of 36

Logging information across different spreadsheets w/out repitition

Hybrid View

  1. #1
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,937

    Re: Logging information across different spreadsheets w/out repitition

    Well this code does exactly the same as the 5-page lines of code you hade.
    The only thing you need to do is rename the week sheets, Monday through Friday (withou the numbers to Monday (1) .... Friday (1) (notice the blank between the weekday and the first (

    the code is this

    Public Sub CreateJobs_Click()
    Dim LastRow     As Long
    Dim weekLoop    As Integer
    Dim wsB         As Worksheet    '*  variable for the Bookings worksheet
    Dim wsWD        As Worksheet    '*  variable for the applicable week worksheet week day
    Dim wks         As Integer
    Dim dys         As Integer
    Dim dayName     As String
    Dim tSheet      As String
    Dim bTable      As Object
    Set bTable = Worksheets("Bookings").ListObjects("Table2")
    bTable.Range.AutoFilter Field:=6
    Application.ScreenUpdating = False
    Set wsB = Worksheets("Bookings")
    LastRow = wsB.Cells(Rows.Count, "B").End(xlUp).Row
    For wks = 1 To numberOfWeeks
        For dys = 1 To numberOfDays
            dayName = Choose(dys, "Monday", "Tuesday", "Wednesday", "Thursday", "Friday")
            tSheet = dayName & " (" & wks & ")"
            Application.StatusBar = tSheet
            Set wsWD = Worksheets(tSheet)
            wsWD.Range("B5", "D450").ClearContents
            With bTable
                .Range.AutoFilter Field:=6
                .Range.AutoFilter Field:=6, Criteria1:=dayName & wks
            End With
            wsB.Range("B2:D450").Copy
            wsWD.Cells(Rows.Count, 2).End(xlUp).Offset(1, 0).PasteSpecial xlPasteValues
            Application.CutCopyMode = False
        Next dys
    Next wks
    ClearFilter_Click
    Application.ScreenUpdating = True
    Application.StatusBar = False
    ClearFilter_Click
    End Sub
    This does not do anything new like keeping duplicates it's just you macro made efficient and.. I am still waiting for the answer to my question

    IMPORTANT: insert a new VBA module and make sure the macros are Public (move the ClearFilter_Click macro to this project and make it public too)
    Last edited by Keebellah; 08-16-2017 at 04:10 PM. Reason: Additional information
    ---
    Hans
    "IT" Always crosses your path!
    May the (vba) code be with you... if it isn't; start debugging!
    If you like my answer, Click the * below to say thank-you

+ 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. how to count repitition
    By naeemdotcom in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 11-27-2015, 02:35 AM
  2. [SOLVED] Pulling information from various spreadsheets
    By lhalpin in forum Excel General
    Replies: 14
    Last Post: 11-23-2015, 01:23 AM
  3. Replies: 5
    Last Post: 11-02-2012, 03:08 AM
  4. Comparing information in two spreadsheets
    By jjackson in forum Excel General
    Replies: 3
    Last Post: 07-31-2009, 09:12 PM
  5. [SOLVED] Logging a website information.
    By Nneuromancer in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 08-18-2006, 08:25 AM
  6. [SOLVED] Eliminating data repitition
    By Graham in forum Excel General
    Replies: 1
    Last Post: 06-08-2005, 11:05 AM
  7. removing repitition from cells...
    By excelguru in forum Excel General
    Replies: 1
    Last Post: 01-20-2005, 06:41 PM

Tags for this Thread

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