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 |
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 |