Wrox Programmer Forums
|
Excel VBA Discuss using VBA for Excel programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Excel VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 24th, 2007, 11:42 AM
Authorized User
 
Join Date: Dec 2006
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default Help with View

Good day all,

So I picked up a book at Barnes n' Nobles last week and started formally learning Code for VB. Not as Hard as I thought. I was wondering of someone out there could help me with the following exercise.....

I want to make the current active cell the upperleft most cell in the current view. So for example.....the Active cell is R33 and I hit the "button", I want it to make R33 the upperleft most cell on the screen. Kind of like where A1 is the upperleftmost cell when you open Excel at first.

I need this little bit of code to finish my first gheto Hallo world "finder" Macro.

Anyone have any ideas, dont have to be to pretty.


 
Old February 1st, 2007, 04:17 PM
Registered User
 
Join Date: Jan 2007
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Wazar,

Try the following:-

Private Sub CommandButton1_Click()
Dim rw As Long
Dim cl As Long
rw = ActiveCell.Row
cl = ActiveCell.Column
Range("A1").Select
ActiveWindow.SmallScroll Down:=rw - 1
ActiveWindow.SmallScroll ToRight:=cl - 1
Cells(rw, cl).Select
End Sub

 
Old February 20th, 2007, 12:43 PM
Authorized User
 
Join Date: Dec 2006
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Cool.....

That was simple. I see now how to tie it all together. Thanks friend, this really helps me in my development!






Similar Threads
Thread Thread Starter Forum Replies Last Post
Urgent - Send mail with plain view and html view ashish.dadhwal ASP.NET 2.0 Professional 0 November 27th, 2008 01:49 AM
How to view picture by using form view? mysecondlove ASP.NET 2.0 Basics 1 April 8th, 2008 07:17 AM
any idea to view xml as it is but in hieratic view seco XSLT 2 January 17th, 2008 08:49 AM
Help Grid View Drop Down List, view all jskinner123 ASP.NET 2.0 Basics 0 November 25th, 2007 06:25 PM
populate details view or list view non empty rows iinfoque ASP.NET 2.0 Basics 0 March 11th, 2007 06:11 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.