ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Selecting text only (https://www.excelbanter.com/excel-programming/334439-selecting-text-only.html)

Sethaholic[_12_]

Selecting text only
 

Hi,

I'm a big newbie, and I'm sure there's an easy way to do this. First,
here is the area in my vba code that I am having a problem with:

Selection.AutoFilter
Selection.AutoFilter Field:=1, Criteria1:="=*" & v(i) & "*"
Selection.AutoFilter Field:=4, Criteria1:="20040630", Operator:=xlOr,
Criteria2:="0"
Range("B1").Select
Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy

It works fine as long as there is text, however, when the coloumns are
blank, it copies the entire column, including the blank rows. Since I
am trying to paste whatever I copy into another worksheet, how can I
make it so that it only copies the text within that area that I am
trying to copy. Thanks in advance.


--
Sethaholic
------------------------------------------------------------------------
Sethaholic's Profile: http://www.excelforum.com/member.php...o&userid=25113
View this thread: http://www.excelforum.com/showthread...hreadid=386935



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

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