PC Review


Reply
Thread Tools Rate Thread

How can I specify which cell has focus?

 
 
Christian Blackburn
Guest
Posts: n/a
 
      3rd Jul 2008
Hi Gang,

I would like to programmatically advance to a specific cell. Can
someone reply with an example?

Thanks,
Christian Blackburn
 
Reply With Quote
 
 
 
 
Bob Phillips
Guest
Posts: n/a
 
      3rd Jul 2008

Application.Goto worksheets("Sheet2").Range("E5")

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"Christian Blackburn" <(E-Mail Removed)> wrote in message
news:99233a6d-bbad-47a7-89f2-(E-Mail Removed)...
> Hi Gang,
>
> I would like to programmatically advance to a specific cell. Can
> someone reply with an example?
>
> Thanks,
> Christian Blackburn



 
Reply With Quote
 
Tom Ogilvy
Guest
Posts: n/a
 
      3rd Jul 2008
Activecell is the currenlty active cell. to make a cell the activecell

Range("B9").Active - this does not change the selection if B9 is within the
current selection - it just activates B9 within the select. Otherwise, it
selects B9

Range("B9").Select - B9 is now both the activecell and the current
selection.

This is done on that activesheet. If you want to go to another sheet,
activate that sheet first

Worksheets("Sheet2").Activate

Range("B9").Select

--
Regards,
Tom Ogilvy


"Christian Blackburn" wrote:

> Hi Gang,
>
> I would like to programmatically advance to a specific cell. Can
> someone reply with an example?
>
> Thanks,
> Christian Blackburn
>

 
Reply With Quote
 
John Bundy
Guest
Posts: n/a
 
      3rd Jul 2008
Either of these is acceptable
Cells(1, 1).Select
Range("A1").Select
--
-John
Please rate when your question is answered to help us and others know what
is helpful.


"Christian Blackburn" wrote:

> Hi Gang,
>
> I would like to programmatically advance to a specific cell. Can
> someone reply with an example?
>
> Thanks,
> Christian Blackburn
>

 
Reply With Quote
 
Dennis
Guest
Posts: n/a
 
      3rd Jul 2008
To go to Cell B9 on a worksheet called Source use this code in the relevant
place

Me.Sheets("Source").Select
Me.ActiveSheet.Range("B9").Select

"Christian Blackburn" wrote:

> Hi Gang,
>
> I would like to programmatically advance to a specific cell. Can
> someone reply with an example?
>
> Thanks,
> Christian Blackburn
>

 
Reply With Quote
 
Tim Zych
Guest
Posts: n/a
 
      3rd Jul 2008
Range("D2000").Select

or

Application.Goto Range("D2000"), True
will scroll D2000 to the upper left of the window (the True part)

Application.GoTo handles book/sheet activation automatically, where as the
selection does not. When using Select, you must first select the workbook
(if it's not active), then the worksheet, then the range, e.g.

Workbooks("Book2").Activate
Worksheets("Sheet1").Select
Range("D2000").Select

whereas GoTo can do it in one line of code:
Application.Goto Workbooks("Book2").Worksheets("Sheet1").Range("D2000"),
True


--
Tim Zych
www.higherdata.com
Compare data in worksheets and find differences with Workbook Compare
A free, powerful, flexible Excel utility


"Christian Blackburn" <(E-Mail Removed)> wrote in message
news:99233a6d-bbad-47a7-89f2-(E-Mail Removed)...
> Hi Gang,
>
> I would like to programmatically advance to a specific cell. Can
> someone reply with an example?
>
> Thanks,
> Christian Blackburn
>



 
Reply With Quote
 
Christian Blackburn
Guest
Posts: n/a
 
      3rd Jul 2008
Hi Guys,

Thank you all for your help. I didn't even know that you could
specify a range without doing "A6:A6" so that's great. I also
appreciate all the help regarding the need to specify the correct
sheet. Fortunately, right now I have only one sheet, although I get
that I still need to specify it to avoid coding bugs in the future.

Thank you all very much,
Christian Blackburn
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Focus on next blank cell SangelNet Microsoft Excel Programming 14 23rd Jan 2009 09:23 PM
Change Cell focus base on value in first Cell pixelpounder Microsoft Excel Programming 1 10th Nov 2007 11:34 PM
Cell to display text from cell on focus?? sunilkes@gmail.com Microsoft Excel Programming 2 7th Nov 2006 03:23 PM
Set Focus on Cell D8 =?Utf-8?B?U2FuZHk=?= Microsoft Excel Programming 4 11th Sep 2005 10:03 PM
Set focus to cell? Microsoft Excel Programming 1 29th Dec 2004 01:10 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:10 AM.