English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

I am wanting to write an Excel macro that, based on the contents of the currently selected cell, goes to another worksheet, and then finds a cell with the same contents? Any ideas?

Thanks

2007-03-28 15:35:33 · 1 answers · asked by thenameisthesame 4 in Computers & Internet Programming & Design

1 answers

Go to visual basic editor and follow the steps
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If target.value="a" then 'replace a with the value you want to check
sheets("a").select 'replace a with the sheet name you want to go
cells.find(target.value).select 'this finds the text in the sheet that matches the text in the first sheet
'place any code here
sheets("a").select 'replace a with the name of the sheet
End Sub

You can copy this code and try it out.

Do see my cricket spreadsheet (if you like cricket)
http://exceltemplates.blogspot.com/2007/03/icc-cricket-world-cup-2007-excel.html

2007-03-28 22:14:06 · answer #1 · answered by Excel master 1 · 0 0

fedest.com, questions and answers