XL Paste Links Blanks

In XL when we paste links; some blanks come accros as zeros. We want blanks in th esource spreadsheet, to be represented as blanks in the target spreadsheet also.
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

Ingeborg Hawighorst (Microsoft MVP / EE MVE)Connect With a Mentor Microsoft MVP ExcelCommented:
Hello Orange-County-Joe,

linking to a cell that contains a blank will return a zero.


This will return zero if the cell is empty.

To return a blank, you would need to encase it in a check


cheers, teylyn
Dave BrettConnect With a Mentor Vice President - Business EvaluationCommented:
To use Paste Links with Blanks successfully requires some basic code that

  • Copies and paste links the range as per the manual method you tryed
  • Deletes the intended blanks automatically
Please see attached sample code in the file, this can be tailored to accept user input for the source and destination range



Sub PasteLinks()
    Dim rng1 As Range, rng2 As Range
    Set rng1 = Sheets(1).UsedRange
    On Error Resume Next
    Set rng2 = rng1.SpecialCells(xlCellTypeBlanks)
    On Error GoTo 0
    Application.Goto Sheets(2).Range(rng1.Cells(1).Address)
    ActiveSheet.Paste Link:=True
    If Not rng2 Is Nothing Then Sheets(2).Range(rng2.Address) = vbNullString
End Sub

Open in new window

tilsantConnect With a Mentor Commented:
or else u can try this .........u can go to .......Tools >> Options >> View >> UNTICK the "Zero Values"

All Courses

From novice to tech pro — start learning today.