[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Help with Macro to Multiple Tabs Excel

Posted on 2016-11-02
2
Medium Priority
?
72 Views
Last Modified: 2016-11-03
Hello,

Can someone please help me create a macro that will iterate through a link in excel and create several tabs based on values in the link.  In the attached example, I have placed a data validation list in cell B4 as a drop down.  I want to iterate though the values in the link and create tabs of all the values contained in the link.

Thanks in advance for your help
Report-Out.xlsx
0
Comment
Question by:fb1990
[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
2 Comments
 
LVL 23

Accepted Solution

by:
Ejgil Hedegaard earned 2000 total points
ID: 41871230
Check attached.
Macro in Module1.

Option Explicit

Sub CreateReports()
    Dim wsReport As Worksheet, ws As Worksheet
    Dim ListName As Variant
    Dim i As Integer
    
    Application.ScreenUpdating = False
    
    Set wsReport = Worksheets("Report")
    For Each ListName In [NamedList]
        wsReport.Range("C2") = ListName
        wsReport.Copy After:=Sheets(ThisWorkbook.Sheets.Count)
        i = 0
        For Each ws In ThisWorkbook.Worksheets
            If Left(ws.Name, Len(ListName)) = CStr(ListName) Then
                i = i + 1
            End If
        Next ws
        If i > 0 Then
            ActiveSheet.Name = ListName & " " & CStr(i + 1)
        Else
            ActiveSheet.Name = ListName
        End If
    Next ListName
End Sub

Open in new window

Report-Out.xlsm
0
 
LVL 1

Author Closing Comment

by:fb1990
ID: 41872035
Thank you very much.  It worked as expected...
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

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.

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.
Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.

656 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