Results 1 to 10 of 10

Thread: [RESOLVED] Excel Copy Whole Row to Different Sheet

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Dec 2006
    Posts
    293

    Resolved [RESOLVED] Excel Copy Whole Row to Different Sheet

    Hi All

    Want to thank the help i got earlier. Its muchly appreciated

    Just one more :P

    Is it possible to copy a whole row of data to a different sheet on the next free line in that sheet?

    i hope this makes sense

    Thanks in advance

    Crampz

  2. #2
    Discovering Life Siddharth Rout's Avatar
    Join Date
    Feb 2005
    Location
    Mumbai, India
    Posts
    12,001

    Re: Excel Copy Whole Row to Different Sheet

    Is it again related to hyperlink or a general question?
    A good exercise for the Heart is to bend down and help another up...
    Please Mark your Thread "Resolved", if the query is solved


    MyGear:
    ★ CPU ★ Ryzen 5 5800X
    ★ GPU ★ NVIDIA GeForce RTX 3080 TI Founder Edition
    ★ RAM ★ G. Skill Trident Z RGB 32GB 3600MHz
    ★ MB ★ ASUS TUF GAMING X570 (WI-FI) ATX Gaming
    ★ Storage ★ SSD SB-ROCKET-1TB + SEAGATE 2TB Barracuda IHD
    ★ Cooling ★ NOCTUA NH-D15 CHROMAX BLACK 140mm + 10 of Noctua NF-F12 PWM
    ★ PSU ★ ANTEC HCG-1000-EXTREME 1000 Watt 80 Plus Gold Fully Modular PSU
    ★ Case ★ LIAN LI PC-O11 DYNAMIC XL ROG (BLACK) (G99.O11DXL-X)
    ★ Monitor ★ LG Ultragear 27" 240Hz Gaming Monitor
    ★ Keyboard ★ TVS Electronics Gold Keyboard
    ★ Mouse ★ Logitech G502 Hero

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Dec 2006
    Posts
    293

    Re: Excel Copy Whole Row to Different Sheet

    Quote Originally Posted by koolsid View Post
    Is it again related to hyperlink or a general question?
    Sorry. Yes again a hyperlink (if possible). On a different sheet now.

  4. #4
    Discovering Life Siddharth Rout's Avatar
    Join Date
    Feb 2005
    Location
    Mumbai, India
    Posts
    12,001

    Re: Excel Copy Whole Row to Different Sheet

    Like this?

    Code:
    Private Sub Worksheet_FollowHyperlink(ByVal Target As Hyperlink)
        Dim lRow As Long
        
        If Range(Target.Range.Address).Column = 2 Then
            lRow = Sheets("Sheet2").Range("A" & Rows.Count).End(xlUp).Row + 1
            
            Target.Range.EntireRow.Copy Sheets("Sheet2").Rows(lRow)
        End If
    End Sub
    A good exercise for the Heart is to bend down and help another up...
    Please Mark your Thread "Resolved", if the query is solved


    MyGear:
    ★ CPU ★ Ryzen 5 5800X
    ★ GPU ★ NVIDIA GeForce RTX 3080 TI Founder Edition
    ★ RAM ★ G. Skill Trident Z RGB 32GB 3600MHz
    ★ MB ★ ASUS TUF GAMING X570 (WI-FI) ATX Gaming
    ★ Storage ★ SSD SB-ROCKET-1TB + SEAGATE 2TB Barracuda IHD
    ★ Cooling ★ NOCTUA NH-D15 CHROMAX BLACK 140mm + 10 of Noctua NF-F12 PWM
    ★ PSU ★ ANTEC HCG-1000-EXTREME 1000 Watt 80 Plus Gold Fully Modular PSU
    ★ Case ★ LIAN LI PC-O11 DYNAMIC XL ROG (BLACK) (G99.O11DXL-X)
    ★ Monitor ★ LG Ultragear 27" 240Hz Gaming Monitor
    ★ Keyboard ★ TVS Electronics Gold Keyboard
    ★ Mouse ★ Logitech G502 Hero

  5. #5

    Thread Starter
    Hyperactive Member
    Join Date
    Dec 2006
    Posts
    293

    Re: Excel Copy Whole Row to Different Sheet

    Quote Originally Posted by koolsid View Post
    Like this?

    Code:
    Private Sub Worksheet_FollowHyperlink(ByVal Target As Hyperlink)
        Dim lRow As Long
        
        If Range(Target.Range.Address).Column = 2 Then
            lRow = Sheets("Sheet2").Range("A" & Rows.Count).End(xlUp).Row + 1
            
            Target.Range.EntireRow.Copy Sheets("Sheet2").Rows(lRow)
        End If
    End Sub
    do you have another sample of it being used. i put the hyperlink in like last time. but no luck.

  6. #6
    Discovering Life Siddharth Rout's Avatar
    Join Date
    Feb 2005
    Location
    Mumbai, India
    Posts
    12,001

    Re: Excel Copy Whole Row to Different Sheet

    Just replace the code with this code in the sample that I uploaded in your previous workbook.
    A good exercise for the Heart is to bend down and help another up...
    Please Mark your Thread "Resolved", if the query is solved


    MyGear:
    ★ CPU ★ Ryzen 5 5800X
    ★ GPU ★ NVIDIA GeForce RTX 3080 TI Founder Edition
    ★ RAM ★ G. Skill Trident Z RGB 32GB 3600MHz
    ★ MB ★ ASUS TUF GAMING X570 (WI-FI) ATX Gaming
    ★ Storage ★ SSD SB-ROCKET-1TB + SEAGATE 2TB Barracuda IHD
    ★ Cooling ★ NOCTUA NH-D15 CHROMAX BLACK 140mm + 10 of Noctua NF-F12 PWM
    ★ PSU ★ ANTEC HCG-1000-EXTREME 1000 Watt 80 Plus Gold Fully Modular PSU
    ★ Case ★ LIAN LI PC-O11 DYNAMIC XL ROG (BLACK) (G99.O11DXL-X)
    ★ Monitor ★ LG Ultragear 27" 240Hz Gaming Monitor
    ★ Keyboard ★ TVS Electronics Gold Keyboard
    ★ Mouse ★ Logitech G502 Hero

  7. #7

    Thread Starter
    Hyperactive Member
    Join Date
    Dec 2006
    Posts
    293

    Re: Excel Copy Whole Row to Different Sheet

    Quote Originally Posted by koolsid View Post
    Just replace the code with this code in the sample that I uploaded in your previous workbook.
    Yep didnt realise that its copying the formula rather than the value. is it possible to get the value?

  8. #8
    Discovering Life Siddharth Rout's Avatar
    Join Date
    Feb 2005
    Location
    Mumbai, India
    Posts
    12,001

    Re: Excel Copy Whole Row to Different Sheet

    Code:
    Private Sub Worksheet_FollowHyperlink(ByVal Target As Hyperlink)
        Dim lRow As Long
        
        If Range(Target.Range.Address).Column = 2 Then
            lRow = Sheets("Sheet2").Range("A" & Rows.Count).End(xlUp).Row + 1
            
            Target.Range.EntireRow.Copy
            Sheets("Sheet2").Rows(lRow).PasteSpecial xlValues
            
        End If
    End Sub
    or this

    Code:
    Private Sub Worksheet_FollowHyperlink(ByVal Target As Hyperlink)
        Dim lRow As Long
        
        If Range(Target.Range.Address).Column = 2 Then
            If Application.WorksheetFunction.CountA(Sheets("Sheet2").Columns(1)) = 0 Then
                lRow = 1
            Else
                lRow = Sheets("Sheet2").Range("A" & Rows.Count).End(xlUp).Row + 1
            End If
            
            Target.Range.EntireRow.Copy
            Sheets("Sheet2").Rows(lRow).PasteSpecial xlValues
        End If
    End Sub
    Last edited by Siddharth Rout; Jul 22nd, 2012 at 01:29 PM.
    A good exercise for the Heart is to bend down and help another up...
    Please Mark your Thread "Resolved", if the query is solved


    MyGear:
    ★ CPU ★ Ryzen 5 5800X
    ★ GPU ★ NVIDIA GeForce RTX 3080 TI Founder Edition
    ★ RAM ★ G. Skill Trident Z RGB 32GB 3600MHz
    ★ MB ★ ASUS TUF GAMING X570 (WI-FI) ATX Gaming
    ★ Storage ★ SSD SB-ROCKET-1TB + SEAGATE 2TB Barracuda IHD
    ★ Cooling ★ NOCTUA NH-D15 CHROMAX BLACK 140mm + 10 of Noctua NF-F12 PWM
    ★ PSU ★ ANTEC HCG-1000-EXTREME 1000 Watt 80 Plus Gold Fully Modular PSU
    ★ Case ★ LIAN LI PC-O11 DYNAMIC XL ROG (BLACK) (G99.O11DXL-X)
    ★ Monitor ★ LG Ultragear 27" 240Hz Gaming Monitor
    ★ Keyboard ★ TVS Electronics Gold Keyboard
    ★ Mouse ★ Logitech G502 Hero

  9. #9

    Thread Starter
    Hyperactive Member
    Join Date
    Dec 2006
    Posts
    293

    Re: Excel Copy Whole Row to Different Sheet

    Quote Originally Posted by koolsid View Post
    Code:
    Private Sub Worksheet_FollowHyperlink(ByVal Target As Hyperlink)
        Dim lRow As Long
        
        If Range(Target.Range.Address).Column = 2 Then
            lRow = Sheets("Sheet2").Range("A" & Rows.Count).End(xlUp).Row + 1
            
            Target.Range.EntireRow.Copy
            Sheets("Sheet2").Rows(lRow).PasteSpecial xlValues
            
        End If
    End Sub
    Thank you ever so much. You have really helped me out alot today. I cannot thank you enough.

  10. #10
    Discovering Life Siddharth Rout's Avatar
    Join Date
    Feb 2005
    Location
    Mumbai, India
    Posts
    12,001

    Re: [RESOLVED] Excel Copy Whole Row to Different Sheet

    You are welcome
    A good exercise for the Heart is to bend down and help another up...
    Please Mark your Thread "Resolved", if the query is solved


    MyGear:
    ★ CPU ★ Ryzen 5 5800X
    ★ GPU ★ NVIDIA GeForce RTX 3080 TI Founder Edition
    ★ RAM ★ G. Skill Trident Z RGB 32GB 3600MHz
    ★ MB ★ ASUS TUF GAMING X570 (WI-FI) ATX Gaming
    ★ Storage ★ SSD SB-ROCKET-1TB + SEAGATE 2TB Barracuda IHD
    ★ Cooling ★ NOCTUA NH-D15 CHROMAX BLACK 140mm + 10 of Noctua NF-F12 PWM
    ★ PSU ★ ANTEC HCG-1000-EXTREME 1000 Watt 80 Plus Gold Fully Modular PSU
    ★ Case ★ LIAN LI PC-O11 DYNAMIC XL ROG (BLACK) (G99.O11DXL-X)
    ★ Monitor ★ LG Ultragear 27" 240Hz Gaming Monitor
    ★ Keyboard ★ TVS Electronics Gold Keyboard
    ★ Mouse ★ Logitech G502 Hero

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