Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Skip Blank Cells While Copying A List | Excel Worksheet Functions | |||
Maximum Number of Blank Cells between Non Blank Cells in a Range | Excel Worksheet Functions | |||
Copying to blank cells | Excel Discussion (Misc queries) | |||
How do I skip blank cells when copying over a range of cells? | Excel Discussion (Misc queries) | |||
Automatic copying data excluding blank cells | Excel Worksheet Functions |