Quantcast
Channel: Active questions tagged excel - Stack Overflow
Viewing all articles
Browse latest Browse all 88066

VBA Copy/Paste on another sheet excluding blank cells or cells where a formula result = ""

$
0
0

Good morning!

I'm having a problem with the code listed below! It is working as designed, with one exception:

Range b4:b100 are lookup formulas from another sheet where everything below B34 is a #value! error where I'm specifying =iferror(formula),""

It is copying the resulting "" anyway and so the next time I run it again, it begins to paste on the target sheet on B101 rather than B35. How can I specify (in plain english) "Do not use any space on the target sheet with blanks where formulas existed on the source sheet"

Thank you for your time!! See code in question below:

{Sub COPYTOSAVEDWORK()

Sheets("FORMULAWORKED").Range("B4:Q100").Select
Selection.Copy
Sheets("WORKED_CLAIMS").Cells(Rows.Count, "A").End(xlUp).Offset(1). _
PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:=xlNone, SkipBlanks:=True, 
Transpose:=False
Exit Sub
End Sub}

Viewing all articles
Browse latest Browse all 88066

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>