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.
Orange-County-JoeAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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

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

=Sheet2!A1

This will return zero if the cell is empty.

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

=if(isblank(Sheet2!A1),"",Sheet2!A1)

cheers, teylyn
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
DaveCommented:
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

Cheers

Dave

Sub PasteLinks()
    Dim rng1 As Range, rng2 As Range
    Set rng1 = Sheets(1).UsedRange
    rng1.Copy
    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

pastelinks.xls
0
tilsantCommented:
or else u can try this .........u can go to .......Tools >> Options >> View >> UNTICK the "Zero Values"


tils.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Applications

From novice to tech pro — start learning today.