Hi,
I have written a macro to print worksheet to PDF
However, when the macro is finished, the worksheet displays a ghost line of the previous page when I click on cells around the sheet.
This ghost line is in the same place no matter where I click, however, if I scroll down and click, another ghost line appears. Likewise, when scrolling down.
I can stop this from happening if I turn off Private Sub Worksheet_SelectionChange(ByVal Target As Range) but it begins again when I turn it on again.
Here is the SelectionChange code ..
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
'
Select Case (Range("E2").Value)
Case 10
Range("A1").Value = "Type3"
Range("A2").Value = "txtField1"
Case 32
Range("A1").Value = "Type2"
Range("A2").Value = "txtField1,txtField2"
Case Else
Range("E2").Value = 16
Range("A1").Value = "Type1"
Range("A2").Value = "txtField1"
End Select
End Sub
Here is the screen ghost, 1st, 2nd & 3rd scroll down clicking on different cells each time ..
This ghost images are not really there. If I pick a cell behind them, there is only an empty cell. If I print this page, the ghost doesn't print.
Interestingly, when I was Snipping these pictures, Excel was refreshing the screen each time without the ghost.
Any ideas ?
I have written a macro to print worksheet to PDF
However, when the macro is finished, the worksheet displays a ghost line of the previous page when I click on cells around the sheet.
This ghost line is in the same place no matter where I click, however, if I scroll down and click, another ghost line appears. Likewise, when scrolling down.
I can stop this from happening if I turn off Private Sub Worksheet_SelectionChange(ByVal Target As Range) but it begins again when I turn it on again.
Here is the SelectionChange code ..
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
'
Select Case (Range("E2").Value)
Case 10
Range("A1").Value = "Type3"
Range("A2").Value = "txtField1"
Case 32
Range("A1").Value = "Type2"
Range("A2").Value = "txtField1,txtField2"
Case Else
Range("E2").Value = 16
Range("A1").Value = "Type1"
Range("A2").Value = "txtField1"
End Select
End Sub
Here is the screen ghost, 1st, 2nd & 3rd scroll down clicking on different cells each time ..
This ghost images are not really there. If I pick a cell behind them, there is only an empty cell. If I print this page, the ghost doesn't print.
Interestingly, when I was Snipping these pictures, Excel was refreshing the screen each time without the ghost.
Any ideas ?