Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default copy two columns without blanks in the first column

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   Report Post  
Posted to microsoft.public.excel.programming
tom tom is offline
external usenet poster
 
Posts: 570
Default copy two columns without blanks in the first column

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default copy two columns without blanks in the first column

Tom,

Thanks. It works great! The old autofilter trick.......

Jeff

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Copy a column leaving out any blanks Mike Pearson[_2_] Excel Worksheet Functions 5 June 10th 07 02:09 PM
Multiple sets of columns into one set of columns no blanks CathyH Excel Discussion (Misc queries) 0 May 22nd 07 09:11 PM
copy range of cells with blanks then paste without blanks justaguyfromky Excel Worksheet Functions 1 September 3rd 06 07:56 PM
Trying to copy text from 4 columns into 1 column with HTML? evolart Excel Discussion (Misc queries) 3 October 18th 05 08:24 PM
Copy selected cell in column and fill in blanks Bluestar Excel Programming 2 June 15th 05 03:28 PM


All times are GMT +1. The time now is 08:43 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"