Screen viewing

  • Thread starter Thread starter Grace
  • Start date Start date
G

Grace

When my macro is done, I would like it to show certain columns of a sheet.
When I record the keystrokes to do this, it looks fine. But when the macro
runs automatically, it ends up a few columns over. Her is the code I
recorded. What variable could be messing me up ( I think I may have clicked
relative references when I recorded the macro)?

Sheets("Resource Hours").Select
Application.Goto Reference:="R1C1"
ActiveCell.Next.Activate
ActiveCell.Next.Activate
ActiveCell.Next.Activate

Thanks
Dean
 
If you want a certain cell selected

Sheet("Resource Hours").Select
Range("D1").Select
 
What exactly you want to do?
Are you trying to show one after another column
selected, to the user?
Then you need to add code for timing.
Below example will select 1st column(Cell A1), and
then after every 1 second will go to B1,C1..Till J1 (10 columns)

ThisWorkbook.Worksheets("Sheet3").Select
ActiveSheet.Range("A1").Select
i = 1
myTime = Timer
Do Until i = 10
If Fix(Timer) = myTime Then
DoEvents
Else
ActiveCell.Next.Activate
i = i + 1
myTime = Timer
End If
Loop
End Sub

Sharad
 
I also want that cell, say J1, to be in the top left corner. What else do I
need?

Thx
 
No, nothing this complicated. I think Tom has it almost solved for me.
Thanks much!
 
Oh oh!! OK
Try below:

Sheets("Resource Hours").Select
ActiveSheet.Range("A1").Select
ActiveWindow.SmallScroll ToRight:=9

Sharad
 
Grace, do you want the rows before J1 to be hidden? Or simpl the view
to start at J1 (i.e. you could scroll and still see A1->I1?
 
Because you can use:

Range("J1").Select
ActiveWindow.SmallScroll ToRight:=9

The second line there to sroll the window to the right. But the number
"9" I think may depend upon the screen size viewing it, but I am not
sure.
 
This does not seem to work. All I want to do is put cell O1 at the top left
corner of everyone's monitor. Isn't there a way to do that.

Anyone?
Thx
 
I may have a different problem. When I stepped into the macro, I saw it
work. But when I run it, it just seems to ignore the commands to this one
sheet. The last few lines of the macro are (when the macro quits, and I go
back to the Resources sheet, which is the 2nd sheet a user would want to
look at, the cursor is in the last place where data was pasted into it):

ActiveCell.Offset(-1, 2).Range("A1").Select

brk2: Rem

Application.Goto Sheet("Resource Hours").Range("J1"), True

Sheets("Assessment Point Scoring").Select
End Sub

What could be wrong?
 
you say " All I want to do is put cell O1 at the top left corner of
everyone's monitor"

A totally different approach would be to postion a textbox there and
then for the text have it =O1.

I use this on huge sheets with external ranges and use a formula to
tell the last invoice date in the range.
As I say, it is a different way to show the same thing.
 
Range("J1").Select
ActiveWindow.ScrollColumn = ActiveCell.Column
ActiveWindow.ScrollRow = ActiveCell.Row
 
This is totally confusing. In other words, I'd like everyone to be able to
see a typical, decent numbered, block of cells starting with cell O1 at the
top-left corner, e.g., O1 through Y20.

Am I missing something?

D
 
Sub XXX()

'Your Code

'show Cell "O1" in uppper left
ActiveWindow.ScrollColumn = "15"
ActiveWindow.ScrollRow = "1"
End Sub
 
I have to apologize for so badly misunderstanding.

But I have a simple thing you might try.

Create a Custom View with the screen display set the way you
want...O1 in the top left corner.
Name it something i.e. "normal"
Then call that Custom View "normal" at the end of your macro.

You can also hide columns and rows you don't want displayed if you
want to specifically only show a range like O1:Y20. The Custom View
will keep that as well.

ScottD
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top