Results 1 to 13 of 13

Thread: [RESOLVED] Simple Question :)

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jan 2006
    Location
    Montreal, Canada
    Posts
    152

    Resolved [RESOLVED] Simple Question :)

    Is it possible to link an entire row from a worksheet to another in Excel??
    If so, how???

  2. #2
    Frenzied Member
    Join Date
    May 2004
    Location
    Carlisle, PA
    Posts
    1,045

    Re: Simple Question :)

    Yes, it is possible to "link an entire row from a worksheet to another in Excel".

    Do you want a Macro to do this ... manually or when the sheet opens? Or do you want a formula for the "other sheet" to put in all 256 cells of the target row to reference the source row?
    Blessings in abundance,
    All the Best,
    & ENJOY!

    Art . . . . Carlisle, PA . . USA

  3. #3
    Frenzied Member
    Join Date
    May 2004
    Location
    Carlisle, PA
    Posts
    1,045

    Re: Simple Question :)

    Here is a sample formula to put in all the cells in the "linked row" on the destination sheet ...
    Code:
    =IF(ISBLANK(Sheet1!A1),"",Sheet1!A1)
    where:
    Sheet1 is the source sheet name
    A1 is the cell reference for the cell you are loading (I started with A1)

    You can load all these cells with the appropriate formula manually or programmatically. You just need to decide when and how to start the program.
    Blessings in abundance,
    All the Best,
    & ENJOY!

    Art . . . . Carlisle, PA . . USA

  4. #4
    Frenzied Member DKenny's Avatar
    Join Date
    Sep 2005
    Location
    on the good ship oblivion..
    Posts
    1,171

    Re: Simple Question :)

    Or...
    1/ Select the row on the original sheet.
    2/ Copy the row
    3/ On the destination sheet -->Paste Special -->Paste Link
    Declan

    Don't forget to mark your Thread as resolved.
    Take a moment to rate posts that you think are helpful

  5. #5
    Frenzied Member
    Join Date
    May 2004
    Location
    Carlisle, PA
    Posts
    1,045

    Re: Simple Question :)

    Declan ... It took me a minute to find the "Paste Link" button! It is not in the list of radio buttons, but at the bottom of the popup.

    One nice thing about the forumula I provided is that it doesn't write "0"s on the destination sheet in place of blanks on the source sheet.
    Blessings in abundance,
    All the Best,
    & ENJOY!

    Art . . . . Carlisle, PA . . USA

  6. #6
    Frenzied Member DKenny's Avatar
    Join Date
    Sep 2005
    Location
    on the good ship oblivion..
    Posts
    1,171

    Re: Simple Question :)

    Yea, the paste link is not very intuitive.

    On the zeros, one can always set the display option to hide zero values.

    Either way this is very straightforward.
    Declan

    Don't forget to mark your Thread as resolved.
    Take a moment to rate posts that you think are helpful

  7. #7

    Thread Starter
    Addicted Member
    Join Date
    Jan 2006
    Location
    Montreal, Canada
    Posts
    152

    Re: Simple Question :)

    thanks a lot guys,

    I wanted to do it with a macro

    The record macro option helped me..
    And hell yeah the paste link button isn't intuitive.

    Thanks again to both of you

  8. #8
    Frenzied Member
    Join Date
    May 2004
    Location
    Carlisle, PA
    Posts
    1,045

    Re: [RESOLVED] Simple Question :)

    Bill ... the "Record Macro" won't allow you to programmatically select the Row on the Source sheet or on the Destination sheet ... do you want to know how to do that? I'm sure Declan and I will both race to get your solution first! Right, Declan?
    Blessings in abundance,
    All the Best,
    & ENJOY!

    Art . . . . Carlisle, PA . . USA

  9. #9
    Frenzied Member DKenny's Avatar
    Join Date
    Sep 2005
    Location
    on the good ship oblivion..
    Posts
    1,171

    Re: [RESOLVED] Simple Question :)

    Giddy up!!
    Declan

    Don't forget to mark your Thread as resolved.
    Take a moment to rate posts that you think are helpful

  10. #10

    Thread Starter
    Addicted Member
    Join Date
    Jan 2006
    Location
    Montreal, Canada
    Posts
    152

    Re: [RESOLVED] Simple Question :)

    On your mark
    Let's get ready
    Go!!!!

    I need it by a macro.
    By recording the macro the recorder gave me the following

    VB Code:
    1. Rows("32:32").Select
    2.     Selection.Copy
    3.     Sheets("Rep. Total").Select
    4.     Range("A20").Select
    5.     ActiveSheet.Paste Link:=True

  11. #11

    Thread Starter
    Addicted Member
    Join Date
    Jan 2006
    Location
    Montreal, Canada
    Posts
    152

    Re: [RESOLVED] Simple Question :)

    Seems like I got all what I needed because the paste special accomplished what I wanted it to do.

    thanks again for your precious help

  12. #12
    Frenzied Member
    Join Date
    May 2004
    Location
    Carlisle, PA
    Posts
    1,045

    Re: [RESOLVED] Simple Question :)

    Code:
    Option Explicit
    Sub Macro1()
        Dim srcSheet As Worksheet
        Dim dstSheet As Worksheet
        Dim srcRow As Long
        Dim dstRow As Long
        Dim srcShtName As String
        Dim dstShtName As String
        Dim i As Integer
        Dim tStr As String
        
        'Set the source sheet name and row HERE
        srcShtName = "Sheet1"
        'Which row on the source sheet do you want to link?
        srcRow = 1
        
        'Set the target sheet name and row HERE
        dstShtName = "Sheet2"
        'Which row on the destination sheet do you want to link?
        dstRow = 1
        
        'Set the source and destination sheet references
        Set srcSheet = Sheets(srcShtName)
        Set dstSheet = Sheets(dstShtName)
        
        'Load all of the cells by iterating through the columns
        For i = 1 To 256
            'Set up the source cell reference
            tStr = srcShtName & "!" & srcSheet.Cells(srcRow, i).Address
            'Load the completed formula
            dstSheet.Cells(dstRow, i).Formula = "=IF(ISBLANK(" & tStr & "),""""," & tStr & ")"
        Next i
    
        'Clean house
        Set srcSheet = Nothing
        Set dstSheet = Nothing
    
    End Sub
    Oh what fun! ... by the way, quality counts! The one with the most comments wins!
    Last edited by Webtest; Jan 25th, 2006 at 11:26 AM.
    Blessings in abundance,
    All the Best,
    & ENJOY!

    Art . . . . Carlisle, PA . . USA

  13. #13
    Frenzied Member DKenny's Avatar
    Join Date
    Sep 2005
    Location
    on the good ship oblivion..
    Posts
    1,171

    Re: [RESOLVED] Simple Question :)

    (a la Jon Stewart) Damn you, Ten o'Clock conference call!!

    I now cede the field to the victor.
    Declan

    Don't forget to mark your Thread as resolved.
    Take a moment to rate posts that you think are helpful

Posting Permissions

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



Click Here to Expand Forum to Full Width