[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

Question
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

9.0

Search for tab in another workbook

Asked by FPLES in Microsoft Applications, Microsoft Excel Spreadsheet Software

Tags: Microsoft Excel

I am trying to put together some code that I had and some code that I found on this site. I have 2 workbooks and what I am trying to do is to get the workbook that I am working in to..

1. Open another workbook
2. Search for the tab in the workbook that is 1 year ago from today's date
   -ex: Today's tab is Nov 06 and one year ago it was Nov 07.
3. Give me the data that is in a specific range in that specific tab
4. Paste the information back in the workbook that I am working in.

I have tabs named by Month (mmm format) and day (dd format). I keet getting a "400" Error when I run the code and I don't know why it cannot find the tab in the other workbook. If I run the code in the same workbook without the OpenandCopy routine, it works fine, but once I put the Call function in there it crashes. Can anyone provide some help?? Thanks in advance
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
Sub OpenandCopy()
    Workbooks.Open Filename:="H:\ADMIN\Weekly Backlog - 2008.xls"               'open the other workbook"
    Windows("Weekly Backlog - 2008.xls").Activate
    Call FindTabMacro                                                           'select the tab that I want to copy from
    Range("F4:F8").Select                                                       'select the range I want to copy
    Selection.Copy                                                              'copy the highlighted range
    Windows("Automated Weekly Backlog.xls").Activate                            'Activate the workbook that I am working in
    Range("E4").Select                                                          'select the first cell that I want to paste in
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
        :=False, Transpose:=False                                               'Paste the copied celled special (values) to open workbook
End Sub
Public Sub FindTabMacro()
Dim d As String
d = Format(DateAdd("d", 1, DateAdd("yyyy", -1, Now)), "mmm dd")
 
   FindTab d
 
End Sub
 
Public Sub FindTab( _
      ByVal SearchString As String _
   )
   
   Dim TargetWorksheet As Worksheet
   
   For Each TargetWorksheet In Worksheets
      If TargetWorksheet.Name Like SearchString Then
         TargetWorksheet.Activate
         Exit Sub
      End If
   Next TargetWorksheet
   
End Sub
 
Related Solutions
Keywords: Search for tab in another workbook
 
Loading Advertisement...
 
[+][-]11/06/09 04:16 PM, ID: 25764257Accepted Solution

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

About this solution

Zones: Microsoft Applications, Microsoft Excel Spreadsheet Software
Tags: Microsoft Excel
Sign Up Now!
Solution Provided By: ahammar
Participating Experts: 2
Solution Grade: A
 
[+][-]11/06/09 12:43 PM, ID: 25762866Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11/06/09 12:45 PM, ID: 25762876Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11/06/09 12:59 PM, ID: 25762995Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]11/06/09 01:10 PM, ID: 25763082Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]11/06/09 02:04 PM, ID: 25763493Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]11/06/09 04:32 PM, ID: 25764340Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11/06/09 04:45 PM, ID: 25764389Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11/09/09 03:21 PM, ID: 25781133Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20091111-EE-VQP-92 - Hierarchy / EE_QW_3_20080625