Help with Macro generating templates

RccScln

New Member
Joined
Jul 27, 2016
Messages
27
Hi everyone - I am trying to re use a Macro but I am facing some issues.
Could someone help me to do so?
The aim is to print a template which values are based on another spreadsheet.

The macro should scroll from a list (which it seems I cannot change) and produce this template for each set of info.
This is the code.
Could please someone help me to understand how to understand and modify it?
For example the list in I2 how is it made? with data validation?

thanks



Sub Printing()




With Application
.ScreenUpdating = False
.EnableEvents = False
.DisplayAlerts = False
.ScreenUpdating = False
.Calculation = xlCalculationManual
End With


Dim Var(300, 2)


Sheets("New List").Select


LR = Cells(Rows.Count, 4).End(xlUp).Row


For a = 4 To LR
If Cells(a, 4) > 0 Then
k = k + 1
Var(k, 1) = Cells(a, 4)
End If
Next a




Sheets("Output Sheet 2").Select


For Z = 1 To k + 1


If Z < k Then
'Select the borrower
Sheets("Output Sheet 2").Select
Range("I2") = "'" & Var(k - Z, 1)
Calculate


'Rename
ActiveSheet.Copy After:=Sheets(5)
ActiveSheet.Name = "AA" & Var(k - Z, 1)


'Copy and paste values
' Cells.Select
' Selection.Copy
' Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
' :=False, Transpose:=False


End If
Next Z




With Application
.ScreenUpdating = True
.EnableEvents = True
.DisplayAlerts = True
.DisplayFormulaBar = True
.ScreenUpdating = True
End With


End Sub
 

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.

Forum statistics

Threads
1,216,192
Messages
6,129,443
Members
449,509
Latest member
ajbooisen

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top