Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,298
Default Macro question

some good answers. Here's something a little different.
Assume that you have a number of cells that you want to trap entered valued
for, and that these values may change.
on sheet1 select a range for input and name it InputCells
select another range and call this TestValues and put some numbers in here

add this code to the sheet's code page:

Private Sub Worksheet_Change(ByVal Target As Range)
Dim found As Range
Set found = Intersect(Range("inputcells"), Target)
If Not found Is Nothing Then
Set found = Range("TestValues").Find(Target.Value)
If Not found Is Nothing Then
MsgBox "OK"
'worksheets("Sheet2").Activate
End If
End If
End Sub

This will fire OK if any value entered into any of the Input cells matches
any value in the testvalues table.

The following code assunes a range of inputcells as before, but each cell
to its left is the test value for any of the input cells...this then will
fire if the value enetered into an input cell matches th evalue in the cell
to its left

Private Sub Worksheet_Change(ByVal Target As Range)

Dim found As Range
Set found = Intersect(Range("inputcells"), Target)

If Not found Is Nothing Then
If found.Offset(0, -1).Value = Target.Value Then
MsgBox "OK"
'worksheets("Sheet2").Activate
End If
End If

End Sub

The objectiove here is to demonstrate possibilities

Patrick Molloy
Microsoft Excel MVP

"ew" wrote:

I need to build a macro that will take the user to another worksheet when a
specific value is entered into a cell. Any suggestions?
Thanks,
ew

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
Excel 2007 Macro/VB Question DDE Question MadDog22 Excel Worksheet Functions 1 March 10th 10 01:47 AM
Macro question Gilbert Excel Discussion (Misc queries) 7 November 8th 07 06:15 PM
Macro Question carl Excel Worksheet Functions 0 June 8th 06 03:37 PM
Question about macro Jason Excel Discussion (Misc queries) 0 April 27th 05 10:37 PM
Macro Question? Bob[_51_] Excel Programming 7 April 6th 04 09:17 AM


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

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

About Us

"It's about Microsoft Excel"