Cross-sheet hyperlinking, data insert,lookup

  • Thread starter Thread starter csaba kobol
  • Start date Start date
C

csaba kobol

Hi, I have a problem I am newbie for VBA.
I have a master sheet and a slave sheet.
I want to automatize this:
If I enter/edit something in MasterSheet.Range (CustomerNr) into cell
then excel make a lookup into Slave1Sheet.Range(OrderNr) and if not
exists then copy my entry to
SlaveSheetRange(OrderNr).CoulmnA.LastCell and made a hyperlink vica-
versa for that row/cell, if exists select the last OrderNr for that
CustomerNr. (In slave sheet aren't customer nr. so its some
backtracking for MasterSheet) I cannot change the xls structure.
Please help.
 
You need to write a worksheet_change function. Wroksheet_change get place
on worksheet page in VBA not in modules. to get to the corrrect page go to
botttom of excel worksheet 9normally sheet 1) and right click and select view
code. Place the code on this page. You can experiment with the sample code
below which is from the VBA help menu.


Private Sub Worksheet_Change(ByVal Target As Range)
Target The changed range. Can be more than one cell.

Remarks
This event doesn't occur when cells change during a recalculation. Use the
Calculate event to trap a sheet recalculation.
Example
This example changes the color of changed cells to blue.

Private Sub Worksheet_Change(ByVal Target as Range)
Target.Font.ColorIndex = 5
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top