+ Reply to Thread
Results 1 to 2 of 2

Trying to create a macro that transfers data to locations based on certain criteria

  1. #1
    Registered User
    Join Date
    06-28-2011
    Location
    London, England
    MS-Off Ver
    Excel 2003
    Posts
    3

    Trying to create a macro that transfers data to locations based on certain criteria

    Hi,

    My problem is that I am trying to create a workbook that will send data from one main worksheet to other worksheets, depending on 2 criteria (one is the sheet name and one is the date).
    So far I have a macro that will do the task that I have specified, but it will only send the data in order, arriving at the bottom of the column. It will not overwrite the existing data in the corresponding cells, which I need it to do.

    I was lucky enough to receive some assistance from this forum previously, and here is the code that I have used:
    Sub TransferBetweenSheets()
    Dim shtName As String, MthRng As Range, LngNR As Long

    shtName = Sheets(1).Range("C2").Value
    With Sheets(shtName)
    Set MthRng = .Rows(4).Cells.Find(Sheets(1).Range("C3").Value).Offset(1, 0)
    Debug.Print MthRng.Address
    Set MthRng = .Cells(MthRng.Row + 10000, MthRng.Column).End(xlUp).Offset(1, 0)
    Debug.Print MthRng.Address
    Set MthRng = MthRng.Resize(6, 1)
    MthRng.Cells.Value = Sheets(1).Range("C5:C10").Cells.Value
    Debug.Print MthRng.Address
    End With

    End Sub

    I need to make all of the white cells in the ‘updater’ sheet send their data to their corresponding locations on the ‘Kramers’ sheet (these are highlighted blue).
    I also need the grey cells to the right of this data to be transferred to their corresponding locations (next to column c’s data in the ‘Kramers’ worksheet).

    I understand that this is a complicated task. I have attached the workbook that I am using and I would be very grateful if someone could help me make this macro functional. I previously posted a message in this forum but I don’t think I explained the situation well enough.

    Thanks,

    Jacob
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    12-23-2006
    Location
    germany
    MS-Off Ver
    XL2003 / 2007 / 2010
    Posts
    6,326

    Re: Trying to create a macro that transfers data to locations based on certain criter

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code. Posting code without them makes your code hard to read and difficult to be copied for testing. Highlight your code and click the # at the top of your post window. For more information about these and other tags, found here

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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