print preview do not update (?)

C

CG Rosen

Good evening Group,

Stuck with something I dont seem to able to solve.
The code below works fine, almost. The loop updates
the values in the cells, the embedded textbox is also up-
dating fine but if more then one selection is made in the listbox
the print preview does not update. The text from the
first selection is not changed in the preview when it is
actually is changed in the worksheet.

Can anyone supply some inputs, please?

Brgds

CG Rosen

------------------------------------------------------------------------------------------------------------------
For i = 0 To Me.ListBox1.ListCount - 1

If Me.ListBox1.Selected(i) = True Then

Sheets("print").TextBox1.Text = ""

Sheets("print").Cells(1, 1) = Sheets("Sheet1").Cells((Me.ListBox1.List(i,
1)), 1)
Sheets("print").Cells(2, 1) = Sheets("Sheet1").Cells((Me.ListBox12.List(i,
1)), 2)

Sheets("print").TextBox1.Text = Sheets("Sheet1").Cells((Me.ListBox2.List(i,
1)), 3)

Application.Dialogs(xlDialogPrinterSetup).Show

UserForm1.Hide
Application.Visible = True
ActiveSheet.PrintPreview EnableChanges:=False
Application.Visible = False

End If

Next i

UserForm1.Show

End Sub
 

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