|
-
Jul 22nd, 2012, 11:56 AM
#1
Thread Starter
Hyperactive Member
[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
-
Jul 22nd, 2012, 12:02 PM
#2
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
-
Jul 22nd, 2012, 12:03 PM
#3
Thread Starter
Hyperactive Member
Re: Excel Copy Whole Row to Different Sheet
 Originally Posted by koolsid
Is it again related to hyperlink or a general question?
Sorry. Yes again a hyperlink (if possible). On a different sheet now.
-
Jul 22nd, 2012, 12:24 PM
#4
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
-
Jul 22nd, 2012, 12:43 PM
#5
Thread Starter
Hyperactive Member
Re: Excel Copy Whole Row to Different Sheet
 Originally Posted by koolsid
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.
-
Jul 22nd, 2012, 12:45 PM
#6
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
-
Jul 22nd, 2012, 12:54 PM
#7
Thread Starter
Hyperactive Member
Re: Excel Copy Whole Row to Different Sheet
 Originally Posted by koolsid
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?
-
Jul 22nd, 2012, 01:25 PM
#8
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
-
Jul 22nd, 2012, 01:29 PM
#9
Thread Starter
Hyperactive Member
Re: Excel Copy Whole Row to Different Sheet
 Originally Posted by koolsid
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.
-
Jul 22nd, 2012, 01:32 PM
#10
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|