Please help me with the macro for MS Excel

Posted on 2011-02-17
Last Modified: 2012-05-11
I have an excel book with several sheets, let say 3
i need help with macro to make sure when i run it
all cursors jump to A1 cell and stay there
Question by:rfedorov
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
LVL 33

Assisted Solution

jppinto earned 75 total points
ID: 34919442
Sub position_cursor()
Dim i As Integer
 For i = 1 To ActiveWorkbook.Sheets.Count
    ActiveWorkbook.Sheets(i).Cells(1, 1).Select
 Next i
End Sub

Accepted Solution

jorgeandresserrano earned 350 total points
ID: 34919485
Hi there! I hope this works for you:

Sub MyFunction()

    Dim ws As Worksheet
    Dim name As String
    name =
    'To prevent the ugly blinking
    Application.ScreenUpdating = False
    For Each ws In Worksheets
    Next ws
    Application.ScreenUpdating = True

End Sub

Assisted Solution

ragnarok89 earned 75 total points
ID: 34919504
Sub a1()
  For each sh in Thisworkbook.Sheets
  Next sh
end sub

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
After seeing numerous questions for Dynamic Data Validation I notice that most have used Visual Basic to solve the problem. This suggestion is purely formula based and can be used in multiple rows.
This Micro Tutorial will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

628 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question