nbuddhi
New Member
- Joined
- Jun 23, 2020
- Messages
- 29
- Office Version
- 365
- Platform
- Windows
Dear Team,
I have an automated excel sheet, "Test Report" to extract data from a sheet called "Data Base". Basically sheet, "Data Base" column "A" having the test report numbers and other column having other data. Both sheets in same workbook.
There are thousand of test report data included on the sheet "Data Base" and;
Step 1 : I have to copy test report numbers from cell "A2939" of sheet "Data Base" and paste in the cell "E4" of sheet "Test Report".
Step 2 : Then report will be extracted all the required data as already setup.
Step 3 : Test report have to save as a pdf file in folder "E:\D\PDF"
Step 4 : This should be continue one by one report numbers from range "A2939:A4225" of sheet "Data Base". Paste cell "E4" is fixed.
Kindly help me to correct the following macro to fulfill Step 1, 3 & 4
Thanks & Best Rgds,
Nuwan Buddhika.
I have an automated excel sheet, "Test Report" to extract data from a sheet called "Data Base". Basically sheet, "Data Base" column "A" having the test report numbers and other column having other data. Both sheets in same workbook.
There are thousand of test report data included on the sheet "Data Base" and;
Step 1 : I have to copy test report numbers from cell "A2939" of sheet "Data Base" and paste in the cell "E4" of sheet "Test Report".
Step 2 : Then report will be extracted all the required data as already setup.
Step 3 : Test report have to save as a pdf file in folder "E:\D\PDF"
Step 4 : This should be continue one by one report numbers from range "A2939:A4225" of sheet "Data Base". Paste cell "E4" is fixed.
Kindly help me to correct the following macro to fulfill Step 1, 3 & 4
VBA Code:
Private Sub CommandButton3_Click()
For i = 2939 To 4225
Sheets("Data Base").Range("A" & i).Copy
Sheets("Test Report").Range("E4").PasteSpecial Paste:=xlPasteValues
Application.CutCopyMode = False
Dim fName As String
With ActiveSheet
fName = .Range("E4").Value
.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
"E:\D\PDF\" & fName, Quality:= _
xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas:=False, _
OpenAfterPublish:=True
End With
Next i
End Sub
Thanks & Best Rgds,
Nuwan Buddhika.