Help appreciated

chef

Well-known Member
Joined
Jul 10, 2002
Messages
610
Office Version
  1. 365
  2. 2016
Hi,

Would welcome some help on, what I think is needed is VBA, of which I have very limited knowledge.

I have rows of staff numbers on column A in sheet1

eg
T123456
T123457
T123458

I want to be able to click on any staff number in column A and then display that chosen staff number in cell A1 in sheet2, in order i can then perform a lookup on that staff record.

any help greatly appreciated
regards
chef
 

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.
Try this: right click Sheet1's tab, select View Code and paste in

Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Column = 1 Then Sheets("Sheet2").Range("A1").Value = Target.Value
End Sub
 
Upvote 0
Peter,

Abs brilliant....saves a whole pile of work.

Thanks for the quick reply and help

regards
Ian
 
Upvote 0
Peter,

Can I also ask its its possible to click on any staff number and automatically go to sheet 2?

regards
 
Upvote 0
Try

Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Column = 1 Then
    With Sheets("Sheet2")
        .Range("A1").Value = Target.Value
        .Select
    End With
End If
End Sub
 
Upvote 0
Hi,

I am really sorry to bump this up again but this has saved my dept sooo much work.

Next thing I would like to do, if possible, is:-

once i go to chosen record on sheet2 i can display staff absence record etc....can i then click on text with "Staff Record" (cell g1,sheet 2) or a button on sheet 2 to automatically open up a word document with that member of staff's personal file based on staff record number?... I would reference and save the word document in a folder g/public/chef/staffrec

and save staff records eg T123456.doc etc

hope this makes sense..and achievable. I'm trying to open up an individuals staff record by clicking on a cell in excel and open associated word file.

regards
ian
 
Upvote 0
Sorry, opening Word from Excel is not my forte. Try starting a new thread.
 
Upvote 0

Forum statistics

Threads
1,224,584
Messages
6,179,691
Members
452,938
Latest member
babeneker

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