Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Go back to the cell that I started from

If user selects D20 as the starting point and moves everywhere on the same
worksheet, how can i go back to where I started at. The following is what I
did but the Range(strPlace).Select returns an error. MsgBox returns 4,20
(D20) for example

Dim strPlaceRow, strPlaceColumn, strPlace As String
strPlaceColumn = ActiveCell.Column
strPlaceRow = ActiveCell.Row
strPlace = strPlaceColumn & "," & strPlaceRow

Do While Selection.Value = "not tired"

Loop

MsgBox strPlace
Range(strPlace).Select


Thanks for the help
John




  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Go back to the cell that I started from

You just needed to use the set command. Don't declare strplace as a string.

Sub test()

Set strPlace = ActiveCell
Do While Selection.Value = "not tired"
Range("B100").Select
Loop

MsgBox strPlace
strPlace.Select

End Sub


"John Shelton" wrote:

If user selects D20 as the starting point and moves everywhere on the same
worksheet, how can i go back to where I started at. The following is what I
did but the Range(strPlace).Select returns an error. MsgBox returns 4,20
(D20) for example

Dim strPlaceRow, strPlaceColumn, strPlace As String
strPlaceColumn = ActiveCell.Column
strPlaceRow = ActiveCell.Row
strPlace = strPlaceColumn & "," & strPlaceRow

Do While Selection.Value = "not tired"

Loop

MsgBox strPlace
Range(strPlace).Select


Thanks for the help
John





  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Go back to the cell that I started from

Well Duh! Brain fart. Thanks so much.

John

"Joel" wrote in message
...
You just needed to use the set command. Don't declare strplace as a
string.

Sub test()

Set strPlace = ActiveCell
Do While Selection.Value = "not tired"
Range("B100").Select
Loop

MsgBox strPlace
strPlace.Select

End Sub


"John Shelton" wrote:

If user selects D20 as the starting point and moves everywhere on the
same
worksheet, how can i go back to where I started at. The following is
what I
did but the Range(strPlace).Select returns an error. MsgBox returns 4,20
(D20) for example

Dim strPlaceRow, strPlaceColumn, strPlace As String
strPlaceColumn = ActiveCell.Column
strPlaceRow = ActiveCell.Row
strPlace = strPlaceColumn & "," & strPlaceRow

Do While Selection.Value = "not tired"

Loop

MsgBox strPlace
Range(strPlace).Select


Thanks for the help
John







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
cell vlue based on cell back colour Esradekan Excel Worksheet Functions 7 April 3rd 10 05:49 PM
Hyperlink from one.xlsx cell to another two.xlxs cell & click back Bobbi-Joe Excel Worksheet Functions 1 August 7th 09 07:18 PM
copy-paste started misbehaving (cell reference wrong) [email protected] Excel Discussion (Misc queries) 1 April 17th 07 07:09 AM
How do I. VLOOKUP & BRING BACK THE CELL BELOW THE CELL WHICH IS FO Chris Excel Worksheet Functions 2 November 16th 06 02:42 AM
Change an empty cell back to a blank cell ... LarryLev[_2_] Excel Programming 3 September 20th 06 06:23 PM


All times are GMT +1. The time now is 12:21 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"