VBA: Using target to fill cell in another worksheet (but first cell in current row)

riggadoo

New Member
Joined
Oct 18, 2013
Messages
2
Please help. I am using Excel 2010 and I have the following code which fills a cell in a different worksheet (CanMakeTool) with the contents of the currently selected cell. It works fine...

Code:
Sub HyperlinkCanMake()
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Count = 1 Then Sheets("CanMakeTool").Cells(1, 1) = Target


End Sub

However I want the "target" to be the first cell in the (currently selected cell's) row. For example...

A:8 = "N123", I have cell H:8 selected which contains something else.
I want the contents of column A <of what="" ever="" row="" i="" select=""> to be inserted into the sheet "CanMakeTool" rather that the contents of my current selection - in this example "N123"

I hope this makes sense.</of>
 
Hi

Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    If Target.Count = 1 Then Sheets("CanMakeTool").Cells(1) = Range("A" & Target.Row).Value
End Sub
 
Upvote 0
Reviving an old thread...

this code will work for me. except i need to show content from Columns A,B,C,D,E. Not just A of the selected cell.
 
Upvote 0

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top