Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 194
  • Last Modified:

Please help me with the macro for MS Excel

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
rfedorov
Asked:
rfedorov
3 Solutions
 
jppintoCommented:
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
 
jorgeandresserranoCommented:
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
 
ragnarok89Commented:
Sub a1()
  For each sh in Thisworkbook.Sheets
  sh.Range("A1").select
  Next sh
end sub
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now