+ Reply to Thread
Results 1 to 20 of 20

Macro that copies based on cell value

Hybrid View

  1. #1
    Registered User
    Join Date
    01-22-2014
    Location
    Compton, whup whup
    MS-Off Ver
    Excel 2010
    Posts
    108

    Re: Macro that copies based on cell value

    I don't think you are understanding me. I want to copy and paste a range of (formulas) into ALL of the five sheets that I have open. The formula that I have above works fine for doing that. When I'm done with that, I want to copy the result of the formulas (they are lookups) and paste special values back into the master tab, into a sheet called "2014". Each of the open workbooks has a date in A3. In the master workbook, in row 14, there are sequential dates. I want to copy the range that I copied into the open workbooks (the lookups) and copy this back into the master file "2014" tab, BASED on the dates in A3 of the open files. So, the macro will look at that row, match it (there will always be a match) and copy the range two cells below row 14. Make sense?

  2. #2
    Registered User
    Join Date
    01-22-2014
    Location
    Compton, whup whup
    MS-Off Ver
    Excel 2010
    Posts
    108

    Re: Macro that copies based on cell value

    I've attached an example of what I want in a spreadsheet. The first sheet is one of the open files and the second tab is the tab in the master file that I want to copy to. Hope this helps.
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    01-22-2014
    Location
    Compton, whup whup
    MS-Off Ver
    Excel 2010
    Posts
    108

    Re: Macro that copies based on cell value

    I also noticed that the code in my first post that I used was incorrect. It's actually this.

    Sub WBLoop()
        Dim wbk As Workbook
        Dim wb1 As Workbook
        Set wb1 = ThisWorkbook
            
        For Each wbk In Workbooks
            If wbk.Name <> ThisWorkbook.Name And wbk.Name <> "Personal.xls" Then
            wb1.Sheets("Lookup").Range("copyrange").Copy wbk.Sheets("Sheet1").Range("R7")
            End If
        Next wbk
         
    End Sub

  4. #4
    Registered User
    Join Date
    01-22-2014
    Location
    Compton, whup whup
    MS-Off Ver
    Excel 2010
    Posts
    108

    Re: Macro that copies based on cell value

    Helloooooo. Nobody can help with this one? It seems like a fairly easy code.

  5. #5
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,169

    Re: Macro that copies based on cell value

    Hey freshfruit,

    The file you attached has no macro in it. If you attach a sample that has the data in sheet 1 and the macro, I can comment the code and see if I can figure it out. No guarantees though as I work for free.
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  6. #6
    Registered User
    Join Date
    01-22-2014
    Location
    Compton, whup whup
    MS-Off Ver
    Excel 2010
    Posts
    108

    Re: Macro that copies based on cell value

    What? I don't have a macro!! I NEED a macro. Instructions again:

    In the attached sheet, there is a tab called "Data sheet". This represents all of the open workbooks. In A3 there is a date, match this date to the dates in row 3, workbook and tab "2014masterfile" and copy the content starting in row 7 below the date in 2014 masterfile.

  7. #7
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Macro that copies based on cell value

    Quote Originally Posted by freshfruit View Post
    What? I don't have a macro!! I NEED a macro. Instructions again:

    In the attached sheet, there is a tab called "Data sheet". This represents all of the open workbooks. In A3 there is a date, match this date to the dates in row 3, workbook and tab "2014masterfile" and copy the content starting in row 7 below the date in 2014 masterfile.
    Just a warning!!

    Common courtesy is the order of the day. Avoid coarse language, personal attacks and inflammatory remarks. Address your concerns at topics and not at people.

    User names that are deemed offensive or in poor taste are subject to being changed or banned.
    Regards

    Fotis.

    -This is my Greek whisper to Europe.

    --Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

    Advanced Excel Techniques: http://excelxor.com/

    --KISS(Keep it simple Stupid)

    --Bring them back.

    ---See about Acropolis of Athens.

    --Visit Greece.

+ 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. [SOLVED] Wirte macro that copies data from 1 cell to a different cell based on data in a third cell
    By Geoff Jones in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 12-11-2013, 12:37 PM
  2. Macro thats copies data based on 2 variables.
    By dwilkinson12 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-17-2013, 10:34 AM
  3. [SOLVED] Macro that removes rows based on frequency and copies part of the row to a new sheet
    By njmiller31 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 10-28-2012, 05:32 PM
  4. [SOLVED] Macro which copies based on row and column inputs
    By buntalan80 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-22-2012, 07:23 PM
  5. [SOLVED] macro which copies all column values based on specific string inputs
    By buntalan80 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 07-12-2012, 03:08 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