Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Copying non-blank cells in a range - XL97

I have a range say A1:M50. I would like to select a row say A1:M1 and copy
the non-blank cells and transpose the values to another sheet. The blank
cells would vary from row to row.

Thanks as always,
Steve




  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 32
Default Copying non-blank cells in a range - XL97

Steve,

Below is some basic VBA code to accomplish what you want. You can also
accomplish by selecting the entire range of cells and then from the menubar:
Edit | Goto , click the Special button, click the Contants radio button,
click OK That will select the non-blank cells. Then use Copy, and Paste
Special with "Skip Blanks" and "Transpose" checked.

Troy


Range("A1:M1").SpecialCells(xlCellTypeConstants, 23).Copy
Range("A11").PasteSpecial Paste:=xlAll, _
Operation:=xlNone, SkipBlanks:=True, _
Transpose:=True

Application.CutCopyMode = False 'Cancel marquee box.


"Steve Jones" wrote in message
...
I have a range say A1:M50. I would like to select a row say A1:M1 and

copy
the non-blank cells and transpose the values to another sheet. The blank
cells would vary from row to row.

Thanks as always,
Steve






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
Maximum Number of Blank Cells between Non Blank Cells in a Range Mal Excel Worksheet Functions 5 November 3rd 07 08:21 AM
Copying to blank cells scorpiorc Excel Discussion (Misc queries) 3 December 6th 06 08:27 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
Automatic copying data excluding blank cells Wesley Excel Worksheet Functions 6 November 30th 04 01:17 AM


All times are GMT +1. The time now is 06: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"