Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 161
Default cell top of screen

Is there a way when a cell is selected in a procedure when the procedure is
done that cell is in the top left portion of the screen?
Thanks
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default cell top of screen

Sub demo()
Set r = Range("Z100")
Application.Goto r, scroll:=True
End Sub
--
Gary''s Student - gsnu200768


"ranswert" wrote:

Is there a way when a cell is selected in a procedure when the procedure is
done that cell is in the top left portion of the screen?
Thanks

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 161
Default cell top of screen

I tried your example with the following changes:

set ycell = range(costid)
Application.Goto ycell, Scroll:=True

costid is a named cell in my worksheet

when i try to run this I get an error

What am I doing wrong?
Thanks

"Gary''s Student" wrote:

Sub demo()
Set r = Range("Z100")
Application.Goto r, scroll:=True
End Sub
--
Gary''s Student - gsnu200768


"ranswert" wrote:

Is there a way when a cell is selected in a procedure when the procedure is
done that cell is in the top left portion of the screen?
Thanks

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default cell top of screen

set ycell = range("costid")

otherwise Excel thinks you are using a variable called costid.
--
Gary''s Student - gsnu200768
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 161
Default cell top of screen

I am using costid

'dim costid as string" is how I declare it.

"Gary''s Student" wrote:

set ycell = range("costid")

otherwise Excel thinks you are using a variable called costid.
--
Gary''s Student - gsnu200768



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default cell top of screen

Sub demo()
Dim costid As String
costid = "costid"
Set ycell = Range(costid)
Application.Goto ycell, scroll:=True
End Sub

This assumes that you have Defined the Name in the worksheet.

--
Gary''s Student - gsnu200768
  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,489
Default cell top of screen

Hi,

Replace example references with desired cell.

Application.Goto Reference:=Worksheets("Sheet1").Range("A154"), _
Scroll:=True

Cheers
Andy

ranswert wrote:
Is there a way when a cell is selected in a procedure when the procedure is
done that cell is in the top left portion of the screen?
Thanks


--

Andy Pope, Microsoft MVP - Excel
http://www.andypope.info
  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default cell top of screen

Probably the simplest way is:

Sub cellTotop()
Set x = ActiveCell
Application.Goto x, scroll:=True
End Sub

This way you don't have to worry about named ranges vs variables.


"ranswert" wrote:

Is there a way when a cell is selected in a procedure when the procedure is
done that cell is in the top left portion of the screen?
Thanks

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
Arrow keys move screen instead of moving from cell to cell LuisGe Excel Discussion (Misc queries) 3 May 22nd 09 11:17 PM
Inputbox Location on Screen. Can you code it to popup lower on the screen ? Corey Excel Programming 3 December 13th 06 11:33 PM
print box opens in right screen of dual screen setup why gerrys Excel Discussion (Misc queries) 1 June 30th 06 06:47 PM
Arrow keys move screen instead of moving from cell to cell. JaJay777 Setting up and Configuration of Excel 1 January 17th 05 06:48 PM
How to copy data from excel to power point screen by screen? luvgreen[_3_] Excel Programming 0 April 9th 04 03:51 PM


All times are GMT +1. The time now is 04:09 AM.

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"