Solved

Please help me with the macro for MS Excel

Posted on 2011-02-17
3
180 Views
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
0
Comment
Question by:rfedorov
3 Comments
 
LVL 33

Assisted Solution

by:jppinto
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
0
 

Accepted Solution

by:
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 = ActiveSheet.name
   
    'To prevent the ugly blinking
    Application.ScreenUpdating = False
   
    For Each ws In Worksheets
        ws.Activate
        ws.Range("A1").Select
    Next ws
   
    ThisWorkbook.Worksheets(name).Activate
   
    Application.ScreenUpdating = True

End Sub
0
 
LVL 8

Assisted Solution

by:ragnarok89
ragnarok89 earned 75 total points
ID: 34919504
Sub a1()
  For each sh in Thisworkbook.Sheets
  sh.Range("A1").select
  Next sh
end sub
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

What is a Form List Box? (skip if you know this) The forms List Box is the alternative to the ActiveX list box. If you are using excel 2007, you first make sure you have a developer tab (click the Orb)->"Excel Options"->Popular->"Show Developer tab…
Approximate matching with VLOOKUP and MATCH seems to me to be a greatly under-used technique, and one which is vital for getting good performance out of large lookups. Until recently I would always have advised using an exact match for simplicity an…
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.

747 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now