+ Reply to Thread
Results 1 to 4 of 4

Copy range from other workbook

Hybrid View

  1. #1
    Registered User
    Join Date
    03-30-2013
    Location
    Home
    MS-Off Ver
    Excel 2010
    Posts
    17

    Copy range from other workbook

    Hi all,

    probably an easy question, but i´m having problems.

    I would like to on the click of a button in my sheet (master.xlsm/sheet1) to have the macro open another sheet (updates.xls/sheet1) , select everything except column A, copy it and paste it into the current sheet (master.xlsm/sheet1).. again ignoring column A. needs to paste with formatting, backgrounds etc....

    Then I need to match in column T, U and V if the string M3 is found to make the background a light red, more like rose...

    Any suggestions ?

    I have tried a few thing but am way to embarrassed to show the futile efforts here.

  2. #2
    Valued Forum Contributor
    Join Date
    03-29-2013
    Location
    United Kingdom
    MS-Off Ver
    Office/Excel 2013
    Posts
    1,749

    Re: Copy range from other workbook

    'To Open :
       Workbooks.Open Filename:="C:\ProgramData\Excel Projects\Local.xls"
    
    'Select the sheet for copying
       sheet1.select
    
    'To Copy
       Range("B1:Z50").copy
    
    'To return to master wb
       Thisworkbook.activate
    
    'Select the sheet for pasting
       sheet1.activate
    
    'select the top left cell of the paste range
       Range("B1").select
    
    'Paste
       activesheet.paste
    Elegant Simplicity............. Not Always

  3. #3
    Registered User
    Join Date
    03-30-2013
    Location
    Home
    MS-Off Ver
    Excel 2010
    Posts
    17

    Re: Copy range from other workbook

    Ahhhh, interesting take..

    I was thinking of arrays and doing it all in memory before pasting.. lol.. but am no good at arrays at all.

    Your approach is plain, simple and effective. tx for that. now for the conditional formatting.

  4. #4
    Registered User
    Join Date
    03-30-2013
    Location
    Home
    MS-Off Ver
    Excel 2010
    Posts
    17

    Re: Copy range from other workbook

    here is another cool way.. Wow one line to copy all you want. I did a range from Col F to Col AI to play with. works great.

    Sub CopyDatatoSheet()
    Sheets("Sheet2").Columns("F:AI").Copy Destination:=Sheets("Sheet1").Columns("F:AI")
    End Sub
    now still for the conditional formatting. any takers ?

+ 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