Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 159
Default Go Immediately To A Particular Cell After Inputting Data In AnotherCell And Hitting Enter

I'm inputting data in E3 and after I hit enter I want B2 to be
selected. But only for E3 and only in one worksheet. And possibly a
further step... Sometimes the formula in B2 has picked up data from
another place depending on what value was entered in E3. If it's done
this then I won't need to go to B2, I'd want to go to A8 after E3
instead of B2.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,565
Default Go Immediately To A Particular Cell After Inputting Data In Another Cell And Hitting Enter

Put this in the code module of the worksheet that contains the ranges you
are working with. Right click the sheet name tab, select View Code from the
pop up menu and paste this into the code window that appears on screen.

Private Sub Worksheet_Change(ByVal Target As Range)
If Target = Range("E3") Then
If Range("B2") 0 Then
Range("A8").Select
Else
Range("B2").Select
End If
End If
End Sub




"robzrob" wrote in message
...
I'm inputting data in E3 and after I hit enter I want B2 to be
selected. But only for E3 and only in one worksheet. And possibly a
further step... Sometimes the formula in B2 has picked up data from
another place depending on what value was entered in E3. If it's done
this then I won't need to go to B2, I'd want to go to A8 after E3
instead of B2.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,565
Default Go Immediately To A Particular Cell After Inputting Data In Another Cell And Hitting Enter

Need to modify the code.

Private Sub Worksheet_Change(ByVal Target As Range)
If Target = Range("E3") Then
If Range("B2").Value "" Then
Range("A8").Select
Else
Range("B2").Select
End If
End If


It sees the formula as greater than zero, but not the empty string.


"robzrob" wrote in message
...
I'm inputting data in E3 and after I hit enter I want B2 to be
selected. But only for E3 and only in one worksheet. And possibly a
further step... Sometimes the formula in B2 has picked up data from
another place depending on what value was entered in E3. If it's done
this then I won't need to go to B2, I'd want to go to A8 after E3
instead of B2.



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 159
Default Go Immediately To A Particular Cell After Inputting Data InAnother Cell And Hitting Enter

On Feb 21, 12:25*am, "JLGWhiz" wrote:
Need to modify the code.

Private Sub Worksheet_Change(ByVal Target As Range)
* *If Target = Range("E3") Then
* * * If Range("B2").Value "" Then
* * * * *Range("A8").Select
* * * Else
* * * * *Range("B2").Select
* * * End If
* *End If

It sees the formula as greater than zero, but not the empty string.

"robzrob" wrote in message

...



I'm inputting data in E3 and after I hit enter I want B2 to be
selected. *But only for E3 and only in one worksheet. *And possibly a
further step... *Sometimes the formula in B2 has picked up data from
another place depending on what value was entered in E3. *If it's done
this then I won't need to go to B2, I'd want to go to A8 after E3
instead of B2.- Hide quoted text -


- Show quoted text -


Perfect. Thank you.
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 159
Default Go Immediately To A Particular Cell After Inputting Data InAnother Cell And Hitting Enter

On Feb 21, 12:25*am, "JLGWhiz" wrote:
Need to modify the code.

Private Sub Worksheet_Change(ByVal Target As Range)
* *If Target = Range("E3") Then
* * * If Range("B2").Value "" Then
* * * * *Range("A8").Select
* * * Else
* * * * *Range("B2").Select
* * * End If
* *End If

It sees the formula as greater than zero, but not the empty string.

"robzrob" wrote in message

...



I'm inputting data in E3 and after I hit enter I want B2 to be
selected. *But only for E3 and only in one worksheet. *And possibly a
further step... *Sometimes the formula in B2 has picked up data from
another place depending on what value was entered in E3. *If it's done
this then I won't need to go to B2, I'd want to go to A8 after E3
instead of B2.- Hide quoted text -


- Show quoted text -


Spoke too soon! I have another macro in this workbook which, after
the workbook has been used, clears all the values from all the cells -
including E3. Now it won't work because when it gets to this line

Range("E3:E5").Select
Selection.ClearContents

in my code, 'your' code is activated and it all come to a standstill.


  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,565
Default Go Immediately To A Particular Cell After Inputting Data In Another Cell And Hitting Enter

Try it with this modification:

Private Sub Worksheet_Change(ByVal Target As Range)
If Target = Range("E3") And Target < "" Then
If Range("B2").Value "" Then
Range("A8").Select
Else
Range("B2").Select
End If
End If




"JLGWhiz" wrote in message
...
Need to modify the code.

Private Sub Worksheet_Change(ByVal Target As Range)
If Target = Range("E3") Then
If Range("B2").Value "" Then
Range("A8").Select
Else
Range("B2").Select
End If
End If


It sees the formula as greater than zero, but not the empty string.


"robzrob" wrote in message
...
I'm inputting data in E3 and after I hit enter I want B2 to be
selected. But only for E3 and only in one worksheet. And possibly a
further step... Sometimes the formula in B2 has picked up data from
another place depending on what value was entered in E3. If it's done
this then I won't need to go to B2, I'd want to go to A8 after E3
instead of B2.





  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 159
Default Go Immediately To A Particular Cell After Inputting Data InAnother Cell And Hitting Enter

On Feb 21, 1:15*am, "JLGWhiz" wrote:
Try it with this modification:

Private Sub Worksheet_Change(ByVal Target As Range)
* *If Target = Range("E3") And Target < "" Then
* * * If Range("B2").Value "" Then
* * * * *Range("A8").Select
* * * Else
* * * * *Range("B2").Select
* * * End If
* *End If

"JLGWhiz" wrote in message

...



Need to modify the code.


Private Sub Worksheet_Change(ByVal Target As Range)
* If Target = Range("E3") Then
* * *If Range("B2").Value "" Then
* * * * Range("A8").Select
* * *Else
* * * * Range("B2").Select
* * *End If
* End If


It sees the formula as greater than zero, but not the empty string.


"robzrob" wrote in message
...
I'm inputting data in E3 and after I hit enter I want B2 to be
selected. *But only for E3 and only in one worksheet. *And possibly a
further step... *Sometimes the formula in B2 has picked up data from
another place depending on what value was entered in E3. *If it's done
this then I won't need to go to B2, I'd want to go to A8 after E3
instead of B2.- Hide quoted text -


- Show quoted text -


Still won't go. Strange, 'my' macro has more than one line of code in
it which selects E3, but it executes some of those, but stops at one
particular one.

Having this macro isn't vital, so don't spend time on it if there are
more interesting things about. Thanks for your help, I've learnt a
few things from it. I'll have a think and a fiddle and see what I can
come up with.
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
Cell changes to a formula after hitting ENTER PerryK Excel Discussion (Misc queries) 4 October 8th 08 05:14 PM
Data entry commitment without hitting Enter key Why Tea Excel Programming 2 December 5th 07 11:00 PM
After Creating New Tab I Hit <Enter, How Do I Make it Go Immediately to a Given Cell? [email protected] Excel Programming 2 September 18th 06 08:57 PM
Update a chart immediately after inputting data into data source MELMEL Charts and Charting in Excel 1 December 1st 05 09:34 PM
moving the cell pointer after hitting enter mporter501 Excel Programming 0 April 7th 04 07:36 PM


All times are GMT +1. The time now is 02:51 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"