ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   SkipBlanks doen't (https://www.excelbanter.com/excel-programming/381192-re-skipblanks-doent.html)

Chip Pearson

SkipBlanks doen't
 
SkipBlanks is badly named and a bit quirky. It does NOT "condense" a pasted
range to paste only non-blank values. For example, if A1:A5 contains

A
<blank
C
<blank
E

and you PasteSpecial SkipBlanks = True into B1, the result is NOT
A
C
E

Instead, the result will look the same as A1:A5. What SkipBlanks does is not
paste empty values over into the destination range. The contents of the
destination corresponding to the blank cells in the source are not changed.
For example, if A1:A5 is as described above, and B1:B5 has

<blank
B
<blank
D
<blank

the result of PatseSpecial SkipBlanks = True is

A
B
C
D
E

The blank cells in A1:A5 are not paste over into B1:B5, and the contents of
B1:B5 corresponding to the blank cells in A1:A5 are not changed.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
(email address is on the web site)


"Jim Tibbetts" wrote in message
...
I have a column of data that has apostrophies which are removed for further
processing. After the apostrophies are removed I want to copy the column
of
data to another column without the blanks that are left over after the
removal of the apostrophies. The following is what I have, but blanks are
still pasted in Column F. What am I missing?

For rwIndex = 2 To 501
For colIndex = 2 To 2
With Worksheets("WhoHas").Cells(rwIndex, colIndex)
If Len(Trim(.Value)) = 0 Then .ClearContents
End With
Next colIndex
Next rwIndex
Range("WhoHas!B2:B126").Select
Selection.Copy
Range("WhoHas!F2").Select
Selection.PasteSpecial Paste:=xlValues, SkipBlanks:=True

Thanks
--
Jim T





All times are GMT +1. The time now is 10:05 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com