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

I want to be able to enter numbers into cells A1 through A10. Once I've
reached cell A10 I want it to automatically jump to Cell B1. How can I
accomplish this?
  #2   Report Post  
Posted to microsoft.public.excel.programming
jjk jjk is offline
external usenet poster
 
Posts: 42
Default Entering Data

I guess this is what you are looking for.
I have hardcoded it for selection of row 11. You can play around with
that.

Private Sub Worksheet_SelectionChange(ByVal Target As Range)

If Target.Row = 11 Then
Target.Offset(1 - Target.Row, 1).Select
End If

End Sub

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Entering Data

Do I just enter this code into Cell A11???

"jjk" wrote:

I guess this is what you are looking for.
I have hardcoded it for selection of row 11. You can play around with
that.

Private Sub Worksheet_SelectionChange(ByVal Target As Range)

If Target.Row = 11 Then
Target.Offset(1 - Target.Row, 1).Select
End If

End Sub


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Entering Data


Use this code. This is the SelectionChange event.

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Address = "$A$10" Then
Range("B10").Select
End If
End Sub

or to do it for every column

If Target.Row = 10 then
Cells(1,Taget.Column +1).Select
End If


--
TommySzalapski
------------------------------------------------------------------------
TommySzalapski's Profile: http://www.excelforum.com/member.php...o&userid=25561
View this thread: http://www.excelforum.com/showthread...hreadid=390277

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Entering Data

Chip Pearson's page on Events
http://www.cpearson.com/excel/events.htm

you would place it in the Sheet module of the sheet where you want the
activity. right click on the sheet tab and select view code.

--
Regards,
Tom Ogilvy

"Programming Cells" wrote in
message ...
Do I just enter this code into Cell A11???

"jjk" wrote:

I guess this is what you are looking for.
I have hardcoded it for selection of row 11. You can play around with
that.

Private Sub Worksheet_SelectionChange(ByVal Target As Range)

If Target.Row = 11 Then
Target.Offset(1 - Target.Row, 1).Select
End If

End Sub






  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 923
Default Entering Data

No. You enter into the code sheet behind the worksheet. Right-click on the
worksheet tab and choose View Code, the editor opens, and paste the code
there.

--
Cheers
Nigel



"Programming Cells" wrote in
message ...
Do I just enter this code into Cell A11???

"jjk" wrote:

I guess this is what you are looking for.
I have hardcoded it for selection of row 11. You can play around with
that.

Private Sub Worksheet_SelectionChange(ByVal Target As Range)

If Target.Row = 11 Then
Target.Offset(1 - Target.Row, 1).Select
End If

End Sub




  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Entering Data

What if I want to save the document and go back into it another time.

How do I maintain the source code.

Currently when I exit and go back in the source does not work anymore.

"TommySzalapski" wrote:


Use this code. This is the SelectionChange event.

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Address = "$A$10" Then
Range("B10").Select
End If
End Sub

or to do it for every column

If Target.Row = 10 then
Cells(1,Taget.Column +1).Select
End If


--
TommySzalapski
------------------------------------------------------------------------
TommySzalapski's Profile: http://www.excelforum.com/member.php...o&userid=25561
View this thread: http://www.excelforum.com/showthread...hreadid=390277


  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Entering Data

Did you save the workbook after you added the code?

--
Regards,
Tom Ogilvy

"Programming Cells" wrote in
message ...
What if I want to save the document and go back into it another time.

How do I maintain the source code.

Currently when I exit and go back in the source does not work anymore.

"TommySzalapski" wrote:


Use this code. This is the SelectionChange event.

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Address = "$A$10" Then
Range("B10").Select
End If
End Sub

or to do it for every column

If Target.Row = 10 then
Cells(1,Taget.Column +1).Select
End If


--
TommySzalapski
------------------------------------------------------------------------
TommySzalapski's Profile:

http://www.excelforum.com/member.php...o&userid=25561
View this thread:

http://www.excelforum.com/showthread...hreadid=390277




  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Entering Data

yes I did

"Tom Ogilvy" wrote:

Did you save the workbook after you added the code?

--
Regards,
Tom Ogilvy

"Programming Cells" wrote in
message ...
What if I want to save the document and go back into it another time.

How do I maintain the source code.

Currently when I exit and go back in the source does not work anymore.

"TommySzalapski" wrote:


Use this code. This is the SelectionChange event.

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Address = "$A$10" Then
Range("B10").Select
End If
End Sub

or to do it for every column

If Target.Row = 10 then
Cells(1,Taget.Column +1).Select
End If


--
TommySzalapski
------------------------------------------------------------------------
TommySzalapski's Profile:

http://www.excelforum.com/member.php...o&userid=25561
View this thread:

http://www.excelforum.com/showthread...hreadid=390277





  #10   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Entering Data


Go to tools - Macro - Security and change the security level from hig
to medium. Reopen your file and click Enable when it asks about macros
If that does not work than you have somehow deleted your code. And
apologize for the error in my first post. Those numbers should hav
been 11, not 10. Thank for the correction jjk

--
TommySzalapsk
-----------------------------------------------------------------------
TommySzalapski's Profile: http://www.excelforum.com/member.php...fo&userid=2556
View this thread: http://www.excelforum.com/showthread.php?threadid=39027



  #11   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Entering Data

no problem. i found that i did not have the complete vb authorization
package installed.

This works great. Thanks.

Can I also put in a macro so that if I do not reach the end of the cell I
can manually call a macro that forces me to the next beginning cell?

"TommySzalapski" wrote:


Go to tools - Macro - Security and change the security level from high
to medium. Reopen your file and click Enable when it asks about macros.
If that does not work than you have somehow deleted your code. And I
apologize for the error in my first post. Those numbers should have
been 11, not 10. Thank for the correction jjk.


--
TommySzalapski
------------------------------------------------------------------------
TommySzalapski's Profile: http://www.excelforum.com/member.php...o&userid=25561
View this thread: http://www.excelforum.com/showthread...hreadid=390277


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
transfering data in another column entering more sorted data Kevin - Corporate Services Excel Worksheet Functions 0 August 6th 08 09:23 PM
Entering Data need help Excel Discussion (Misc queries) 1 February 13th 08 07:04 PM
entering data using tab Karen Boyd Excel Discussion (Misc queries) 1 October 21st 05 12:00 AM
Entering data on template and then data going to a spreadsheet. KJH Excel Discussion (Misc queries) 3 December 24th 04 01:04 AM
entering data bdcrisp[_24_] Excel Programming 1 January 6th 04 07:43 PM


All times are GMT +1. The time now is 12:39 AM.

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"