#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22
Default RETURN TO C

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 38
Default RETURN TO C

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22
Default RETURN TO C

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 38
Default RETURN TO C

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
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
Return date if in range, else return blank LisaL Excel Worksheet Functions 1 July 22nd 09 03:23 PM
Compare Value in Cell 1 to a List, Return Value if Match otherwise Return Null Ben Excel Discussion (Misc queries) 2 March 15th 07 01:02 AM
LOOKUP and return the column heading for IF/THEN return for False NN Excel Discussion (Misc queries) 1 October 6th 06 11:24 AM
check if reference exists, then return its value or return 0 doudou Excel Worksheet Functions 1 June 4th 05 09:17 PM
VBA Syntax for VLOOKUP to return array of return values Alan Beban[_3_] Excel Programming 7 August 5th 03 11:41 AM


All times are GMT +1. The time now is 01:07 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"