PC Review


Reply
Thread Tools Rate Thread

Basic newbie question

 
 
John
Guest
Posts: n/a
 
      26th Jan 2007
I have a setup of a manually entered grid of data with 40 rows and 12
columns. Each week I need to update Row1 Col1, move to Col 10 and enter
some data, then on to Row2 Col1 ... Col10, etc...

I would like to code the following...
After data is entered in Row1 Col1, move to Row1 Col10, after data is
entered in Row1 Col10, move to Row2 Col1, etc..

What code would do that for me? I think if I could see the code to do one
iteration, I can figure out how to loop it for 40 rows.

Thanks in advance,
John


 
Reply With Quote
 
 
 
 
Jason Lepack
Guest
Posts: n/a
 
      26th Jan 2007
As long as you are actually changing something in each cell then you
could place this macro into your Worksheet under "Tools->Macros->VB
Editor"

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 10 Then
Target.Offset(1, 1).Select
ElseIf Target.Column = 11 Then
Target.Offset(0, -1).Select
End If
End Sub

If it's a systematic change that is doen every day, you could automate
it.

Cheers,
Jason Lepack
On Jan 26, 4:46 pm, "John" <a...@msnewsgroups.com> wrote:
> I have a setup of a manually entered grid of data with 40 rows and 12
> columns. Each week I need to update Row1 Col1, move to Col 10 and enter
> some data, then on to Row2 Col1 ... Col10, etc...
>
> I would like to code the following...
> After data is entered in Row1 Col1, move to Row1 Col10, after data is
> entered in Row1 Col10, move to Row2 Col1, etc..
>
> What code would do that for me? I think if I could see the code to do one
> iteration, I can figure out how to loop it for 40 rows.
>
> Thanks in advance,
> John


 
Reply With Quote
 
John
Guest
Posts: n/a
 
      26th Jan 2007
Jason,
OK... that's just what I need. I have two other tables of data on that
worksheet that require different "shifting" schemes, but now I know I can
ask where the cursor is and move accordingly. Just what I neeed... a
start...
I'm thinking I may be able to interrogate what "Range" I'm in as well as
what column.

Thanks Jason,
John

"Jason Lepack" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> As long as you are actually changing something in each cell then you
> could place this macro into your Worksheet under "Tools->Macros->VB
> Editor"
>
> Private Sub Worksheet_Change(ByVal Target As Range)
> If Target.Column = 10 Then
> Target.Offset(1, 1).Select
> ElseIf Target.Column = 11 Then
> Target.Offset(0, -1).Select
> End If
> End Sub
>
> If it's a systematic change that is doen every day, you could automate
> it.
>
> Cheers,
> Jason Lepack
> On Jan 26, 4:46 pm, "John" <a...@msnewsgroups.com> wrote:
>> I have a setup of a manually entered grid of data with 40 rows and 12
>> columns. Each week I need to update Row1 Col1, move to Col 10 and enter
>> some data, then on to Row2 Col1 ... Col10, etc...
>>
>> I would like to code the following...
>> After data is entered in Row1 Col1, move to Row1 Col10, after data is
>> entered in Row1 Col10, move to Row2 Col1, etc..
>>
>> What code would do that for me? I think if I could see the code to do
>> one
>> iteration, I can figure out how to loop it for 40 rows.
>>
>> Thanks in advance,
>> John

>



 
Reply With Quote
 
Jason Lepack
Guest
Posts: n/a
 
      26th Jan 2007
You can use Target.Row in the same fashion.

Target.Address will give you the address of the cell in the form "$A$1"

Cheers,
Jason Lepack

On Jan 26, 5:51 pm, "John" <a...@msnewsgroups.com> wrote:
> Jason,
> OK... that's just what I need. I have two other tables of data on that
> worksheet that require different "shifting" schemes, but now I know I can
> ask where the cursor is and move accordingly. Just what I neeed... a
> start...
> I'm thinking I may be able to interrogate what "Range" I'm in as well as
> what column.
>
> Thanks Jason,
> John
>
> "Jason Lepack" <jlep...@gmail.com> wrote in messagenews:(E-Mail Removed)...
>
> > As long as you are actually changing something in each cell then you
> > could place this macro into your Worksheet under "Tools->Macros->VB
> > Editor"

>
> > Private Sub Worksheet_Change(ByVal Target As Range)
> > If Target.Column = 10 Then
> > Target.Offset(1, 1).Select
> > ElseIf Target.Column = 11 Then
> > Target.Offset(0, -1).Select
> > End If
> > End Sub

>
> > If it's a systematic change that is doen every day, you could automate
> > it.

>
> > Cheers,
> > Jason Lepack
> > On Jan 26, 4:46 pm, "John" <a...@msnewsgroups.com> wrote:
> >> I have a setup of a manually entered grid of data with 40 rows and 12
> >> columns. Each week I need to update Row1 Col1, move to Col 10 and enter
> >> some data, then on to Row2 Col1 ... Col10, etc...

>
> >> I would like to code the following...
> >> After data is entered in Row1 Col1, move to Row1 Col10, after data is
> >> entered in Row1 Col10, move to Row2 Col1, etc..

>
> >> What code would do that for me? I think if I could see the code to do
> >> one
> >> iteration, I can figure out how to loop it for 40 rows.

>
> >> Thanks in advance,
> >> John


 
Reply With Quote
 
John
Guest
Posts: n/a
 
      26th Jan 2007
Thanks Jason,
I'm digging in there as we speak...
John

"Jason Lepack" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> You can use Target.Row in the same fashion.
>
> Target.Address will give you the address of the cell in the form "$A$1"
>
> Cheers,
> Jason Lepack
>
> On Jan 26, 5:51 pm, "John" <a...@msnewsgroups.com> wrote:
>> Jason,
>> OK... that's just what I need. I have two other tables of data on
>> that
>> worksheet that require different "shifting" schemes, but now I know I can
>> ask where the cursor is and move accordingly. Just what I neeed... a
>> start...
>> I'm thinking I may be able to interrogate what "Range" I'm in as well
>> as
>> what column.
>>
>> Thanks Jason,
>> John
>>
>> "Jason Lepack" <jlep...@gmail.com> wrote in
>> messagenews:(E-Mail Removed)...
>>
>> > As long as you are actually changing something in each cell then you
>> > could place this macro into your Worksheet under "Tools->Macros->VB
>> > Editor"

>>
>> > Private Sub Worksheet_Change(ByVal Target As Range)
>> > If Target.Column = 10 Then
>> > Target.Offset(1, 1).Select
>> > ElseIf Target.Column = 11 Then
>> > Target.Offset(0, -1).Select
>> > End If
>> > End Sub

>>
>> > If it's a systematic change that is doen every day, you could automate
>> > it.

>>
>> > Cheers,
>> > Jason Lepack
>> > On Jan 26, 4:46 pm, "John" <a...@msnewsgroups.com> wrote:
>> >> I have a setup of a manually entered grid of data with 40 rows and 12
>> >> columns. Each week I need to update Row1 Col1, move to Col 10 and
>> >> enter
>> >> some data, then on to Row2 Col1 ... Col10, etc...

>>
>> >> I would like to code the following...
>> >> After data is entered in Row1 Col1, move to Row1 Col10, after data is
>> >> entered in Row1 Col10, move to Row2 Col1, etc..

>>
>> >> What code would do that for me? I think if I could see the code to do
>> >> one
>> >> iteration, I can figure out how to loop it for 40 rows.

>>
>> >> Thanks in advance,
>> >> John

>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
newbie basic question Colin Peters Microsoft Dot NET Framework 2 6th May 2009 03:16 AM
Newbie - Basic Question MM_Virgin Windows XP MovieMaker 1 22nd May 2008 04:31 AM
Basic Newbie question Anil Gupte Microsoft C# .NET 8 23rd Oct 2006 10:10 PM
Basic Question for IE 6.0 Newbie... Shaun Windows XP Internet Explorer 2 17th Jan 2004 02:14 AM
basic question from a newbie =?Utf-8?B?Sm9lIEdpYXF1aW50bw==?= Microsoft Windows 2000 Terminal Server Applications 2 12th Nov 2003 11:11 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:20 AM.