Macro to Copy and paste as value to cell A13 from a column in the next sheet and save each iteration as a pdf

jhgiants95

New Member
Joined
Jul 21, 2014
Messages
33
Office Version
  1. 365
Platform
  1. Windows
I have come across a system that requires a significant amount of work hours that I am trying to improve. I have automated the process to now only require the copy and paste of one cell (from an adjacent sheet titled 'Input') to autofill a form. In this case it is being copied to cell A13 of the sheet titled 'Output'.

It needs to be pasted as a value since there are many lookups that are run based off of this that don't seem to work if it is simply copied with formats.

Then this should be saved as a pdf (now that the form has populated) with the name of the file matching the value in cell A13.

This needs to be repeated for every cell in column H of the 'Input' sheet starting in row 2 due to headers. This only needs to function until it reaches a blank cell.

I have done some research and have only been able to find a way to save as a pdf with the appropriate file name but I cant figure out how to loop through the cells in the row and save each 'Output' sheet individually. Any help would be greatly appreciated. Thanks.
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
Code:
Dim c As Range
With Sheets("Input")
 For Each c In .Range("H2", .Cells(Rows.Count, "H").End(xlUp))
    If c <> "" Then
       c.Copy
       Sheets("Output").Range("A13").PasteSpecial xlPasteValues
    End If
    'code to save sheet here
 Next
End With
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,903
Messages
6,175,286
Members
452,631
Latest member
a_potato

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