Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Skip blank cells on transpose in a macro

I am using the following code to copy a column of data and paste
special/transpose into a new workbook:

Windows("Survey.xls").Activate
Range("B7:B21").Select
Selection.Copy
Windows("Book1").Activate
Selection.PasteSpecial Paste:=xlPasteAll, Operation:=xlNone,
SkipBlanks:=False, Transpose:=True

The data in the column on the first workbook looks like this:

Name
<blank
Address
<blank
Phone
<blank
etc.

Is there a way to not paste the blank cells into the new workbook? Changing
the SkipBlanks:= to True didn't seem to work.

Thanks,
Melanie
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Skip blank cells on transpose in a macro

Windows("Survey.xls").Activate
Range("B7:B21").Select
Selection.Copy
Windows("Book1").Activate
Selection.PasteSpecial Paste:=xlPasteAll, Operation:=xlNone,
SkipBlanks:=False, Transpose:=True
On Error Resume Next
selection(1).Resize(1,15).specialCells(xlBlanks).D elete Shift:=xlShiftToLeft
On Error goto 0
--
Regards,
Tom Ogilvy


"Melanie O" wrote in message
...
I am using the following code to copy a column of data and paste
special/transpose into a new workbook:

Windows("Survey.xls").Activate
Range("B7:B21").Select
Selection.Copy
Windows("Book1").Activate
Selection.PasteSpecial Paste:=xlPasteAll, Operation:=xlNone,
SkipBlanks:=False, Transpose:=True

The data in the column on the first workbook looks like this:

Name
<blank
Address
<blank
Phone
<blank
etc.

Is there a way to not paste the blank cells into the new workbook?

Changing
the SkipBlanks:= to True didn't seem to work.

Thanks,
Melanie



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Skip blank cells on transpose in a macro

Thanks, Tom. Worked like a charm!

Melanie

"Tom Ogilvy" wrote:

Windows("Survey.xls").Activate
Range("B7:B21").Select
Selection.Copy
Windows("Book1").Activate
Selection.PasteSpecial Paste:=xlPasteAll, Operation:=xlNone,
SkipBlanks:=False, Transpose:=True
On Error Resume Next
selection(1).Resize(1,15).specialCells(xlBlanks).D elete Shift:=xlShiftToLeft
On Error goto 0
--
Regards,
Tom Ogilvy


"Melanie O" wrote in message
...
I am using the following code to copy a column of data and paste
special/transpose into a new workbook:

Windows("Survey.xls").Activate
Range("B7:B21").Select
Selection.Copy
Windows("Book1").Activate
Selection.PasteSpecial Paste:=xlPasteAll, Operation:=xlNone,
SkipBlanks:=False, Transpose:=True

The data in the column on the first workbook looks like this:

Name
<blank
Address
<blank
Phone
<blank
etc.

Is there a way to not paste the blank cells into the new workbook?

Changing
the SkipBlanks:= to True didn't seem to work.

Thanks,
Melanie




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
Skip Blank Cells While Copying A List shruthitulsi Excel Worksheet Functions 0 December 11th 10 04:52 AM
how do I skip blank cells when writing formulas KatB Excel Worksheet Functions 1 July 11th 06 09:53 PM
Skip blank cells in diagrams hlp Charts and Charting in Excel 9 February 24th 06 02:32 PM
How do I skip blank cells when copying over a range of cells? tawells Excel Discussion (Misc queries) 2 June 7th 05 09:36 PM
how to skip the blank cells nayeemoddin Excel Discussion (Misc queries) 1 December 6th 04 07:07 AM


All times are GMT +1. The time now is 11:02 PM.

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

About Us

"It's about Microsoft Excel"