
Print PDF in Excel X, Search a specific value in cells/Replace value in other cells
Since writing to PDF is a printer-driver specific function, I don't think it
can be scripted within XL.
One way to find and replace with an offset:
Public Sub FindAndReplaceWithOffset()
Const FINDWHAT = "whatever"
Const REPLACEWITH = "replacement"
Const SEARCHCOL As Integer = 1 '"A"
Const COLOFFSET As Integer = 3 '"D"
Dim cell As Range
Application.ScreenUpdating = False
For Each cell In ActiveSheet.Columns( _
SEARCHCOL).SpecialCells(xlCellTypeConstants)
If cell.Value = FINDWHAT Then _
cell.Offset(0, COLOFFSET).Value = REPLACEWITH
Next cell
Application.ScreenUpdating = True
End Sub
On 3/14/02 17:47, in article
Quote:
> Could someone tell me how to write a little script that would print
> documents to PDF format in Excel X? I tried to record the event in
> Macro but the recorded macro doesn't capture the "print to PDF" part.
> Also, could anyone tell me how to look for a specific value in cells
> in a column, and if the value found, replace the value of the cell in
> the same row but different column with another value? Thank you in
> advance!
> Porkbun
--
Office/Mac MVP
Email Address ROT-13 Encoded. Decode for real address.