Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Please help me with the macro for MS Excel

Posted on 2011-02-17
3
Medium Priority
?
188 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
[X]
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
3 Comments
 
LVL 33

Assisted Solution

by:jppinto
jppinto earned 300 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 1400 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 300 total points
ID: 34919504
Sub a1()
  For each sh in Thisworkbook.Sheets
  sh.Range("A1").select
  Next sh
end sub
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

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

This article descibes how to create a connection between Excel and SAP and how to move data from Excel to SAP or the other way around.
If you need to forecast numbers -- typically for finance -- the Windows and Mac versions of Excel 2016 have a basket of tools to get the job done.
This Micro Tutorial will demonstrate on a Mac how to change the sort order for chart legend values and decrpyt the intimidating chart menu.
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

722 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