Consulting

Results 1 to 4 of 4

Thread: copy values to another worksheet in next down cell

  1. #1
    VBAX Newbie
    Joined
    Jan 2013
    Posts
    5
    Location

    copy values to another worksheet in next down cell

    Hello

    every day I need copy the values from worksheet "input" of "material1" , "material2" and "material3" to worksheet name "Board" in next empty cell or correspondent day cell .
    somebody could help me on that ?

    thank you very much

    ccruz
    Attached Files Attached Files

  2. #2
    VBAX Guru Kenneth Hobs's Avatar
    Joined
    Nov 2005
    Location
    Tecumseh, OK
    Posts
    4,956
    Location
    Welcome to the forum!

    In a Module:
    Sub CopyToBoard()
      Dim ws As Worksheet
      For Each ws In Worksheets
        With ws
             If .Name = "board" Or .UsedRange.Cells.Count = 1 Then GoTo NextWS
                .Range("2:" & .UsedRange.Rows.Count).Copy _
                Worksheets("board").Range("A" & Rows.Count).End(xlUp).Offset(1)
            End With
        NextWS:
      Next ws
    End Sub

  3. #3
    VBAX Newbie
    Joined
    Jan 2013
    Posts
    5
    Location
    thank you
    it's copy but also add in column A the word INPUT
    how to remove ?
    is it possible run this macro only once per day ex. 05:00 even with the workbook closed ?

  4. #4
    VBAX Guru Kenneth Hobs's Avatar
    Joined
    Nov 2005
    Location
    Tecumseh, OK
    Posts
    4,956
    Location
    I don't know your needs so I guessed that INPUT was a date like your master data. Of course all of the data copied to Column A in worksheet board could be removed but it is more efficient to just not copy it. One could reference the range less the first row and first column in each slave data sheet. I would have to work on that.

    The best way to run it at a time each day would be to use Application.Run() in another workbook's Open Event and add that workbook to a Window's scheduled event task. That code would Open the workbook, run that macro, and then close it and the scheduled workbook.

Posting Permissions

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