Loop for formula on one sheet with reference from another sheet

V

Valerie

I have a form in XL that currently prints automatically with a macro when I
enter a project number. The list of project numbers is on another sheet in
the workbook. The sheet I am working on is "Close Form" cell
'Range("D2:E2").Select' because it's a merged cell. I would like to have a
macro that writes something like "='Upload Nos'!A1" in this merged cell
looping through col A until the first blank cell in the sheet, "Upload Nos".
I don't have enough macro experience to write it. Can anyone help?
 
B

Bernie Deitrick

Valerie,

Sub ValPrint()
For i = 1 To Worksheets("Upload Nos").Cells(Rows.Count,1).End(xlUp).Row
Worksheets("Close Form").Cells(2,4).Value = _
Worksheets("Upload Nos").Cells(i,1).Value
Application.Calculate
Worksheets("Close Form").PrintOut
Next i
End Sub

HTH,
Bernie
MS Excel MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top