Print PDF in Excel X, Search a specific value in cells/Replace value in other cells 
Author Message
 Print PDF in Excel X, Search a specific value in cells/Replace value in other cells

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



Tue, 31 Aug 2004 08:47:09 GMT  
 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.


Tue, 31 Aug 2004 12:34:17 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. excel cell relations replaced by actual value

2. Select cells that are different from a specific cell value

3. Replace specific occurrences of a value in a field

4. Replace last value in a range of numbers if it satisfies specific criteria

5. Copying a value from one cell to two others automatically

6. syntax for cell value on sheet A = cell value workbook B

7. cells.value = cells.value

8. The list of a cell depends on the value of another cell's value

9. Finding cell by it's value and taking the value of its relative cell

10. Copying data values from one cell to another, based on other cells values


 
Powered by phpBB® Forum Software © phpBB Group