Dear Paul, thank you very much for your reply and your help ! :) I am also happy you think what I am doing is cool, eheh ! I have several excel files, one for each product I have to check. Each file I only use 1 sheet. Your assumption that I know nothing about VBA is totally correct, and I thank you for the explanation you gave in your email. I am using Excel 2007, and the developer menu is enabled ... this is nearly the only thing I can do :p
I have tried to use your code, but I don't know why it seems it does not work, it will not change to a new row .... In the meantime I was asking some other people on the Microsoft forum in Italian, and someone suggested me this code: Private Sub Worksheet_SelectionChange(ByVal Target As Range) Const col As Long = 6 If Target.Column = col Then _ Target.Offset(1, (-1 * col) + 1).Select End Sub with this code it can go down when it reaches the column, but then I don't know why when I move right the first time in the new row, it will jump on row up again. I will keep on trying ! :) Thanks very much again for your help ! Luca. On Apr 22, 1:48 pm, Paul Schreiner <schreiner_p...@att.net> wrote: > Interesting... really cool too.. > Is this Excel file one that you use all the time? > or is it new each time? > all on the same sheet? or new sheets? > > How much do you know about programming in Excel VBA? > I'm rather than wait for 3-4 emails, I'm going to "assume" that > you don't know VBA... you'll have to learn a little along the way. > I'm also going to assume you're using Excel97/2003 (pre 2007) > or if you are using 2007, you've got the Developer menu enabled. > > My first approach would be to create a "change event" in Excel > > Let's say that your fifth measurement is placed in column "E" > > In Excel, right-click on the sheet name and select "View Code" > In the upper section (above the text area) use the pull-down > for the left-hand box to select "Worksheet". > The default "event" is SelectionChange, and the macro is created. > In the right-hand box, use the pull-down to select the "Change" event. > > It will create the sub: > > Private Sub Worksheet_Change(ByVal Target As Range) > End Sub > (you can delete the one: > Private Sub Worksheet_SelectionChange(ByVal Target As Range) > End Sub > ) > > this macro waits for any changes TO THIS SHEET. > the cells changed are passed to the macro as the variable "Target" > > Now, copy/paste this line between the Sub/End Sub lines: > If (Target.Column = 5) Then Cells(Target.Row + 1, 1).Select > > You now have: > Private Sub Worksheet_Change(ByVal Target As Range) > If (Target.Column = 5) Then Cells(Target.Row + 1, 1).Select > End Sub > > this tests to see if the cell changed is in column 5 ("E") > If it is, then it selects the cell in the next row (target.row+1) > and the first column (,1) > > If you want this to work for ALL sheets in a workbook, > we can place a similar macro in another VBA module location. > the name changes, and there is some other changes that you'll need. > > let me know what you think, what your situation is, and if you need more help. > > Paul --~--~---------~--~----~------------~-------~--~----~ ------------------------------------------------------------------------------------- Some important links for excel users: 1. Excel and VBA Tutorials(Video and Text), Free add-ins downloads at http://www.excelitems.com 2. Excel tutorials at http://www.excel-macros.blogspot.com 3. Learn VBA Macros at http://www.vbamacros.blogspot.com 4. Excel Tips and Tricks at http://exceldailytip.blogspot.com To post to this group, send email to excel-macros@googlegroups.com If you find any spam message in the group, please send an email to: Ayush Jain @ jainayus...@gmail.com or Ashish Jain @ 26may.1...@gmail.com ------------------------------------------------------------------------------------- -~----------~----~----~----~------~----~------~--~---