Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hopefully someone out there can make this happen for me. I have data
coming from SQL into Excel that includes dates (in column "a", for ex.), and then two additional data elements (columns "b" and "c" for ex.) of data. I need to sort through column "b", and where a value exists, copy that cell and the cell in column "a" to a second worksheet into the same columnar format. The trick that is stumping me is I need to skip the blanks in column "b". In other words, sheet2 needs to have column "a" and 'b" without the blanks. The column range is from a6:a110, b6:b110, c6:c110. If I can get that part, then I can get add the next column to do the same to another sheet. I would sure appreciate the help. Jeff |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Jeff, this code should do what you're looking for:
Sub Copy() Range("B1").Select Selection.AutoFilter Selection.AutoFilter Field:=2, Criteria1:="<" Range("A1:B25").Select Selection.Copy Sheets("Sheet2").Select Range("A1").Select ActiveSheet.Paste Range("A1").Select Sheets("Sheet1").Select Application.CutCopyMode = False Range("A1").Select Selection.AutoFilter End Sub HTH Tom "jeffm" wrote: Hopefully someone out there can make this happen for me. I have data coming from SQL into Excel that includes dates (in column "a", for ex.), and then two additional data elements (columns "b" and "c" for ex.) of data. I need to sort through column "b", and where a value exists, copy that cell and the cell in column "a" to a second worksheet into the same columnar format. The trick that is stumping me is I need to skip the blanks in column "b". In other words, sheet2 needs to have column "a" and 'b" without the blanks. The column range is from a6:a110, b6:b110, c6:c110. If I can get that part, then I can get add the next column to do the same to another sheet. I would sure appreciate the help. Jeff |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Tom,
Thanks. It works great! The old autofilter trick....... Jeff |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Copy a column leaving out any blanks | Excel Worksheet Functions | |||
Multiple sets of columns into one set of columns no blanks | Excel Discussion (Misc queries) | |||
copy range of cells with blanks then paste without blanks | Excel Worksheet Functions | |||
Trying to copy text from 4 columns into 1 column with HTML? | Excel Discussion (Misc queries) | |||
Copy selected cell in column and fill in blanks | Excel Programming |