Para executar as seguintes ações:
VLOOKUP
para extrair outros valores com base na célula atualizada na Etapa 3. Eu tenho o seguinte código VBA:
Sub CreateWorkSheetByRange()
'variable declaration
Dim WorkRng As Range
Dim Ws As Worksheet
Dim arr As Variant
Dim tws As Worksheet
'Start of Program
On Error Resume Next
'Specify the title of the dialog that requests for range
xTitleId = "Select Range"
' Assign template worksheet to a variable
Set tws = Worksheets("template")
' Assign the application.selection function to the variable WorkRng
Set WorkRng = Application.Selection
' Accept input from the user
Set WorkRng = Application.InputBox("Range", xTitleId, WorkRng.Address, Type:=8)
' Create an array of the input values
arr = WorkRng.Value
' The following line is optional
' Application.ScreenUpdating = False
' Create the Worksheet names based on range selected
For i = 1 To UBound(arr, 1)
For j = 1 To UBound(arr, 2)
tws.Copy after:=Worksheets(Sheets.Count)
Set Ws = Application.ActiveSheet
Ws.Name = arr(i, j)
Next
Next
' Application.ScreenUpdating = True
End Sub
Gostaria de melhorar as seguintes coisas no meu código - mas não sei como
Tags microsoft-excel-2010 vba