Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 39
Default VBA code manipulation cells

Hi there,
It is possible with vba code to click a button or 5 buttons in this case to
select the appropriate cell, A1, A20, A40, A60, A80.... as the selection is
made I would like the selected cell to be in the upper left corner, so if I
clicked Cat we would scroll down to cat and row 20 would be the first row
seen? Thanks Craig
A B C
1 Dog

20 Cat

40 Bird

60 Lion

80 Tiger


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,339
Default VBA code manipulation cells

Hi,


This is an example of how to scroll as you require. Attach a similar macro
to your button(s): I don't know how you enter your criteria i.e CAT,DOG etc.


Sub Scroll()

Dim myCell As Range, MyRow As Integer, findstr As String
findstr = InputBox("Enter search argument")

Set myCell = Range("A:A").Find(findstr) ' Find Search argument
ActiveWindow.ScrollRow = myCell.Row 'Scroll to this cell

End Sub

"Craig" wrote:

Hi there,
It is possible with vba code to click a button or 5 buttons in this case to
select the appropriate cell, A1, A20, A40, A60, A80.... as the selection is
made I would like the selected cell to be in the upper left corner, so if I
clicked Cat we would scroll down to cat and row 20 would be the first row
seen? Thanks Craig
A B C
1 Dog

20 Cat

40 Bird

60 Lion

80 Tiger



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,452
Default VBA code manipulation cells

Sub ScrollToCat()
ActiveWindow.ScrollRow = 20
End Sub

Make macro buttons (View, Toolbars, Forms, click button and draw it in the
sheet) in row 1.
Assign to your macros as above.
To keep the buttons visible click in cell A2 and do Window, Freeze Pane.
I suppose dog will have to move to row 2.

RBS


"Craig" wrote in message
news:W246e.946951$6l.337127@pd7tw2no...
Hi there,
It is possible with vba code to click a button or 5 buttons in this case
to select the appropriate cell, A1, A20, A40, A60, A80.... as the
selection is made I would like the selected cell to be in the upper left
corner, so if I clicked Cat we would scroll down to cat and row 20 would
be the first row seen? Thanks Craig
A B C
1 Dog

20 Cat

40 Bird

60 Lion

80 Tiger


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
Value manipulation Vic Excel Discussion (Misc queries) 3 April 3rd 09 03:18 PM
Help w/ Cell Manipulation gm Excel Worksheet Functions 0 January 21st 06 02:38 AM
Bit manipulation Tony Excel Programming 8 March 15th 05 02:11 PM
Halting code for worksheet manipulation? What-a-Tool[_2_] Excel Programming 2 November 5th 04 12:09 AM
Number in string manipulation, obtained by a cells().value Sintel[_3_] Excel Programming 3 September 14th 04 04:49 PM


All times are GMT +1. The time now is 03:26 AM.

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

About Us

"It's about Microsoft Excel"