Hello,
I have create a template which is adapted for an A4 paper area. I want to put it below each other on an Excel sheet and then print to PDF. It worked for MONTHS but all suddenly the area for A4 (settings) changed and my Range numbers were not adapting the A4 paper.
So basically:
..................
.I PASTE HERE
.
.
..................
and then from nowhere after several months the pasting is here:
..................
.
.I PASTE HERE
.
..................
and when this happens, the loop gets 1-2 steps down and the template I made is mixing on the A4 area.
Does anyone know why the area of the A4 changing? Nobody has changed anything with this Excel file nor script.
See my code below for how I paste it (I have updated it to a more simpler and math way, but I am still curious why it changed)
I have create a template which is adapted for an A4 paper area. I want to put it below each other on an Excel sheet and then print to PDF. It worked for MONTHS but all suddenly the area for A4 (settings) changed and my Range numbers were not adapting the A4 paper.
So basically:
..................
.I PASTE HERE
.
.
..................
and then from nowhere after several months the pasting is here:
..................
.
.I PASTE HERE
.
..................
and when this happens, the loop gets 1-2 steps down and the template I made is mixing on the A4 area.
Does anyone know why the area of the A4 changing? Nobody has changed anything with this Excel file nor script.
See my code below for how I paste it (I have updated it to a more simpler and math way, but I am still curious why it changed)
VBA Code:
If pdfcount = 2 Then
Worksheets("PDF").Range("A52").Select
ElseIf pdfcount = 3 Then
Worksheets("PDF").Range("A100").Select
ElseIf pdfcount = 4 Then
Worksheets("PDF").Range("A148").Select
ElseIf pdfcount = 5 Then
Worksheets("PDF").Range("A196").Select
ElseIf pdfcount = 6 Then
Worksheets("PDF").Range("A244").Select
ElseIf pdfcount = 7 Then
Worksheets("PDF").Range("A292").Select
ElseIf pdfcount = 8 Then
Worksheets("PDF").Range("A340").Select
ElseIf pdfcount = 9 Then
Worksheets("PDF").Range("A388").Select
ElseIf pdfcount = 10 Then
'......... And so on up to 20
End If