Help on retrieve data in each worksheet

  • Thread starter Thread starter keldo
  • Start date Start date
K

keldo

I try to write a program to retrieve data from a database for eac
worksheet, but fail :( , would you mind to help me what problems fo
the below codings?

=================================
Sub Macro1()

Dim sh As Worksheet

For Each sh In ThisWorkbook.Worksheets

Range("A1", "AZ171").Select
Application.Run Macro:=("EssMenuRetrieve")
Range("A173", "AZ344").Select
Application.Run Macro:=("EssMenuRetrieve")

Next sh

End Sub
=================================
 
Without knowing what EssMenuRetrieve does, maybe...

Sub Macro1()

Dim sh As Worksheet

For Each sh In ThisWorkbook.Worksheets
sh.select
Range("A1", "AZ171").Select
Application.Run Macro:=("EssMenuRetrieve")
Range("A173", "AZ344").Select
Application.Run Macro:=("EssMenuRetrieve")
Next sh

End Sub
 

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