ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Cross-sheet hyperlinking, data insert,lookup (https://www.excelbanter.com/excel-programming/393387-cross-sheet-hyperlinking-data-insert-lookup.html)

csaba kobol

Cross-sheet hyperlinking, data insert,lookup
 
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.


joel

Cross-sheet hyperlinking, data insert,lookup
 
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



"csaba kobol" wrote:

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.




All times are GMT +1. The time now is 02:42 PM.

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