Alternate Numbers And/Or

  • Hello,


    I have an Excel document that is used primary to to pull data from a report. The phone number is in column C, but we are also working off alternate phone numbers in column D.


    If the phone number field is blank, i'm wondering if a macro can literally pull the alternate phone number in column D to populate the phone number in column C.


    Thank you for any help!

  • Re: Alternate Numbers And/Or


    anything is possible


    1. How is the data "PULLED"
    2. Do you have a small sample?

  • Re: Alternate Numbers And/Or


    How about a formula like =IF(C1="", D1, C1)


    Or a macro like


    Code
    1. With Range("C:C")
    2. On Error Resume Next
    3. With .SpecialCells(xlCellTypeBlanks)
    4. .FormulaR1C1 = "=RC[1]"
    5. .EntireColumn.Value = .EntireColumn.Value
    6. Application.Intersect(.EntireRow, .Parent.Range("D:D")).ClearContents
    7. End With
    8. End With
  • Re: Alternate Numbers And/Or


    The data is pasted from an external report into the sheet so a formula would not work. With a header, it would actually start in row 2.


    Thank you for the macro code, but it completely crashed the workbook after copy/pasting row1 from column D.

  • Re: Alternate Numbers And/Or


    try