ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   when hyperlink pressed can I copy and past the followed cell coten (https://www.excelbanter.com/excel-programming/435818-when-hyperlink-pressed-can-i-copy-past-followed-cell-coten.html)

Rofaiel

when hyperlink pressed can I copy and past the followed cell coten
 
My problem is that I have some goods photo whenever you click a picture it
takes you to another worksheet with Item No. and desc. and price, what I need
to do is when I click an item no. it copy the item no, desc, price to a new
worksheet or new workbook.

Thanks in advance for any help

Don Guillett

when hyperlink pressed can I copy and past the followed cell coten
 
You need a worksheet_doubleclick event that will do this
If desired, send your file to my address below. I will only look if:
1. You send a copy of this message on an inserted sheet
2. You give me the newsgroup and the subject line
3. You send a clear explanation of what you want
4. You send before/after examples and expected results.


--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Rofaiel" wrote in message
...
My problem is that I have some goods photo whenever you click a picture it
takes you to another worksheet with Item No. and desc. and price, what I
need
to do is when I click an item no. it copy the item no, desc, price to a
new
worksheet or new workbook.

Thanks in advance for any help



JLGWhiz[_2_]

when hyperlink pressed can I copy and past the followed cell coten
 
Assuming Item number is in Column A. Copy the code below to the worksheet
with Item number, description and price.

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim lr As Long, sh As Worksheet, rng As Range
Set sh = ActiveSheet
'Get last row with data in col A
lr = sh.Cells(Rows.Count, 1).End(xlUp).Row
Set rng = sh.Range("A2:A" & lr)
If Not Intersect(Target, rng) Is Nothing Then
Set Newsh = Sheets.Add
ThisWorkbook.Save
sh.Range("A" & Target.Row & ":C" & Target.Row).Copy
ActiveSheet.Range("A" & ActiveSheet.Cells(Rows.Count, 1) _
.End(xlUp).Offset(1).Row).PasteSpecial Paste:=xlValues
'You can put a sheet name in quotes beloow and drow the rest.
Newsh.Name = "Sheet" & Sheets.Count
End If
End Sub

If this does not do what you want, then Don's offer is probably your best
bet.




"Rofaiel" wrote in message
...
My problem is that I have some goods photo whenever you click a picture it
takes you to another worksheet with Item No. and desc. and price, what I
need
to do is when I click an item no. it copy the item no, desc, price to a
new
worksheet or new workbook.

Thanks in advance for any help





All times are GMT +1. The time now is 09:42 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com