Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default finding a value

Hi,

How can I find a certain value, say x, in all the sheets
in a workbook or excel file? After finding it, I must
output all the sheet names that has x and its cell
location on a msgbox.

Thanks.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 196
Default finding a value

try this
sub findX()
dim i as integer
dim cell

set X=activecell.value
for i=1 to sheets.count
sheets(i).select
range("A1").select
set a=selection
range(a,a.specialcells(xlcelltypelastcell)).select
for each cell in selection
if cell.value=X.value then
msgbox "X.value is in sheet " & sheet.name
exit for
end if
next
next
end sub

regards
Mark
PS
see my Excel site
http://www.geocities.com/excelmarksway

-----Original Message-----
Hi,

How can I find a certain value, say x, in all the sheets
in a workbook or excel file? After finding it, I must
output all the sheet names that has x and its cell
location on a msgbox.

Thanks.
.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Finding * FARAZ QURESHI Excel Discussion (Misc queries) 1 April 3rd 08 08:50 AM
Finding non-zero value Tom Stout Excel Discussion (Misc queries) 2 November 21st 07 05:20 PM
Finding last used mikefranklin1969 Excel Worksheet Functions 1 May 12th 06 10:05 PM
Finding value tkaplan Excel Discussion (Misc queries) 2 October 21st 05 08:19 PM
finding the "end" Julia New Users to Excel 2 September 1st 05 02:38 AM


All times are GMT +1. The time now is 11:30 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"