Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
CAN SOMEONE SLAP ME SOME CODE THAT ALLOWS ME TO RETURN TO COLUMN C ON THE
NEXT ROW WHENEVER I PRESS ENTER? THANKS!!! -- Message posted via OfficeKB.com http://www.officekb.com/Uwe/Forums.a...mming/200510/1 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I think you are out of luck with that one, how about using an event,
like worksheet change. Private Sub Worksheet_Change(ByVal Target As Range) 'enter your code here End Sub record a macro in relative mode, place your cell where you want to start the macro and then record the macro for example ActiveCell.Offset(1, -3).Range("A1").Select this code starts at F column and goes back 3 and down one, you can insert this into the the code Private Sub Worksheet_Change(ByVal Target As Range) ActiveCell.Offset(1, -3).Range("A1").Select End Sub Now to set the range for this to work only in the F column If Union(Range("$F:$F"), Target).Address = Range("$F:$F").Address Then enter this code at the beginning like this: Private Sub Worksheet_Change(ByVal Target As Range) If Union(Range("$F:$F"), Target).Address = Range("$F:$F").Address Then ActiveCell.Offset(1, -3).Range("A1").Select End If End Sub right click on the sheet tab and select worksheet from the dropdown menu that says general Copy and paste the above code you can change the code or add another code after 'end if' if you wanted another worksheet_change event Dave |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
UMM, WHAT?
damorrison wrote: I think you are out of luck with that one, how about using an event, like worksheet change. Private Sub Worksheet_Change(ByVal Target As Range) 'enter your code here End Sub record a macro in relative mode, place your cell where you want to start the macro and then record the macro for example ActiveCell.Offset(1, -3).Range("A1").Select this code starts at F column and goes back 3 and down one, you can insert this into the the code Private Sub Worksheet_Change(ByVal Target As Range) ActiveCell.Offset(1, -3).Range("A1").Select End Sub Now to set the range for this to work only in the F column If Union(Range("$F:$F"), Target).Address = Range("$F:$F").Address Then enter this code at the beginning like this: Private Sub Worksheet_Change(ByVal Target As Range) If Union(Range("$F:$F"), Target).Address = Range("$F:$F").Address Then ActiveCell.Offset(1, -3).Range("A1").Select End If End Sub right click on the sheet tab and select worksheet from the dropdown menu that says general Copy and paste the above code you can change the code or add another code after 'end if' if you wanted another worksheet_change event Dave -- Message posted via OfficeKB.com http://www.officekb.com/Uwe/Forums.a...mming/200510/1 |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Which part didn't you get?
copy and paste this into your worksheet code, adjust it so it works for your situation Private Sub Worksheet_Change(ByVal Target As Range) If Union(Range("$F:$F"), Target).Address = Range("$F:$F").Address Then ActiveCell.Offset(1, -3).Range("A1").Select End If End Sub |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Lets see your code. Are you familiar with VBA?
|
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
damorrison wrote:
Lets see your code. Are you familiar with VBA? No I am not familiar with VBA. This is my code. Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range) End Sub Private Sub Worksheet_Change(ByVal Target As Range) Cells(Target.Row + 1, 3).Select End Sub -- Message posted via http://www.officekb.com |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
"CAN SOMEONE SLAP ME SOME CODE THAT ALLOWS ME TO RETURN TO COLUMN C ON
THE NEXT ROW WHENEVER I PRESS ENTER? " This was your original post your code: Private Sub Worksheet_Change(ByVal Target As Range) Cells(Target.Row + 1, 3).Select End Sub Code I gave you: Private Sub Worksheet_Change(ByVal Target As Range) If Union(Range("$F:$F"), Target).Address = Range("$F:$F").Address Then ActiveCell.Offset(1, -3).Range("A1").Select End If End Sub Adjust the ranges that work for you |
#8
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Ok, step by step, what does that code do? I don't know what to adjust. So far
there has been no effect. Code I gave you: Private Sub Worksheet_Change(ByVal Target As Range) If Union(Range("$F:$F"), Target).Address = Range("$F:$F").Address Then ActiveCell.Offset(1, -3).Range("A1").Select End If End Sub Adjust the ranges that work for you -- Message posted via http://www.officekb.com |
#9
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
oK, now I realize what your code does. unfortunately what I wanted was a code
to return me to column on the next row from whichever column I happen to be on. Whereas this code seems to allow me to pick one row only? damorrison wrote: "CAN SOMEONE SLAP ME SOME CODE THAT ALLOWS ME TO RETURN TO COLUMN C ON THE NEXT ROW WHENEVER I PRESS ENTER? " This was your original post your code: Private Sub Worksheet_Change(ByVal Target As Range) Cells(Target.Row + 1, 3).Select End Sub Code I gave you: Private Sub Worksheet_Change(ByVal Target As Range) If Union(Range("$F:$F"), Target).Address = Range("$F:$F").Address Then ActiveCell.Offset(1, -3).Range("A1").Select End If End Sub Adjust the ranges that work for you -- Message posted via http://www.officekb.com |
#10
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Give this a try,
Private Sub Worksheet_Change(ByVal Target As Range) Range ("C1").Select ActiveCell.Offset(1, 0).Range("A1").Select End If End Sub That should work, I am on an Island in the Pacific Right now and the computer here doesn't have excel |
#11
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
i SEE. no that did not work, either. Where can I learn of this VBA that you
speak of? damorrison wrote: Give this a try, Private Sub Worksheet_Change(ByVal Target As Range) Range ("C1").Select ActiveCell.Offset(1, 0).Range("A1").Select End If End Sub That should work, I am on an Island in the Pacific Right now and the computer here doesn't have excel -- Message posted via OfficeKB.com http://www.officekb.com/Uwe/Forums.a...mming/200510/1 |
#12
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Eternal_Cat
Where can I learn of this VBA that you speak of? See David McRitchie's introductory notes at: http://www.mvps.org/dmcritchie/excel/getstarted.htm See also David's Tutorials page at: http://www.mvps.org/dmcritchie/excel....htm#tutorials The VBA tutorials appear just below the half way point of that page. Consider, also, purchasing a book: one that might serve your purpose, and which receives frequent recommendation in the NG, is John Walkenbach's 'Excel VBA Programming For Dummies': http://www.j-walk.com/ss/books/bookxl27.htm --- Regards, Norman "eternal_cat via OfficeKB.com" <u14645@uwe wrote in message news:56654ae98bd18@uwe... i SEE. no that did not work, either. Where can I learn of this VBA that you speak of? damorrison wrote: Give this a try, Private Sub Worksheet_Change(ByVal Target As Range) Range ("C1").Select ActiveCell.Offset(1, 0).Range("A1").Select End If End Sub That should work, I am on an Island in the Pacific Right now and the computer here doesn't have excel -- Message posted via OfficeKB.com http://www.officekb.com/Uwe/Forums.a...mming/200510/1 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Return date if in range, else return blank | Excel Worksheet Functions | |||
Compare Value in Cell 1 to a List, Return Value if Match otherwise Return Null | Excel Discussion (Misc queries) | |||
LOOKUP and return the column heading for IF/THEN return for False | Excel Discussion (Misc queries) | |||
check if reference exists, then return its value or return 0 | Excel Worksheet Functions | |||
VBA Syntax for VLOOKUP to return array of return values | Excel Programming |