Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Help copying a range with spaces to a range without spaces

Hi, I'm trying to find the simplest solution (well, any solution) to the
following problem:

1 2 3 4 5 6
A F
B F Y S
C
D G
E

I need to list the above as:

F
F
G
Y
S

In other words listing all the contents of Column 1 from Rows A:E, in the
order they appear, ignoring spaces, followed by the contents of Column 2
etc. Up to Column whatever. There may be duplicates which I want to keep,
except for the spaces.

I can do it in my head, but I have no idea how to code it.

Any ideas?

Andy


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 135
Default Help copying a range with spaces to a range without spaces

This should work:

Sub Tester()
For i = 1 To 5
For j = 1 To 256
sTest = Cells(i, j)
If sTest < Empty Then
LastCell = Cells(65536, 1).End(xlUp).Row
If LastCell < 5 Then LastCell = 5
Cells(LastCell + 1, 1) = sTest
End If
Next j
Next i
Rows("1:5").Delete
End Sub

Regards,
Shockley


"Andy" wrote in message
...
Hi, I'm trying to find the simplest solution (well, any solution) to the
following problem:

1 2 3 4 5 6
A F
B F Y S
C
D G
E

I need to list the above as:

F
F
G
Y
S

In other words listing all the contents of Column 1 from Rows A:E, in the
order they appear, ignoring spaces, followed by the contents of Column 2
etc. Up to Column whatever. There may be duplicates which I want to

keep,
except for the spaces.

I can do it in my head, but I have no idea how to code it.

Any ideas?

Andy




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
copying/sorting data with blank spaces in between? brucefl New Users to Excel 1 March 6th 10 06:19 PM
Need help copying cells into rows with spaces between Doug Titus Excel Discussion (Misc queries) 0 July 25th 08 06:00 PM
how do I remove leading spaces and leave the remianing spaces w Debi Excel Worksheet Functions 6 February 28th 07 03:29 PM
spaces not recognized as spaces windsurferLA Excel Worksheet Functions 9 July 27th 06 11:49 AM
Copy column range of "single word" cells with spaces to a single c nastech Excel Discussion (Misc queries) 3 February 15th 06 05:04 PM


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