ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Skipping Blanks (Again) (https://www.excelbanter.com/excel-discussion-misc-queries/179108-skipping-blanks-again.html)

F. Lawrence Kulchar

Skipping Blanks (Again)
 
I wish to copy 2 columns of numbers as follows:

A B
1 100
2 50
3 85
4
5
6 10
7 15
9 10
10 20 20
11 16



The PASTED TO cells will appear as follows:

A B
1 100 85
2 50 10
3 15 10
4 20 20
5 16


In other words, all occupied cells are filled in from top to bottom,
skipping all blanks.

How is this accomplished?

Thanks,

FLKulchar


Bob Phillips

Skipping Blanks (Again)
 
Public Sub ProcessData()
Dim i As Long, j As Long
Dim LastRow As Long

With ActiveSheet

For j = 1 To 2

LastRow = .Cells(.Rows.Count, j).End(xlUp).Row
For i = LastRow To 2 Step -1

If .Cells(i - 1, j).Value = "" Then

.Cells(i - 1, j).Value = .Cells(i, j).Value
.Cells(i - 1, j).Delete shift:=xlUp
End If
Next i
Next j
End With

End Sub

--
---
HTH

Bob


(there's no email, no snail mail, but somewhere should be gmail in my addy)



"F. Lawrence Kulchar" wrote in
message ...
I wish to copy 2 columns of numbers as follows:

A B
1 100
2 50
3 85
4
5
6 10
7 15
9 10
10 20 20
11 16



The PASTED TO cells will appear as follows:

A B
1 100 85
2 50 10
3 15 10
4 20 20
5 16


In other words, all occupied cells are filled in from top to bottom,
skipping all blanks.

How is this accomplished?

Thanks,

FLKulchar




Pete_UK

Skipping Blanks (Again)
 
A rough and ready way would be to highlight columns A and B down to
the bottom-most value, then click on Edit | GoTo (or press F5), then
click Special and click on Blanks then OK. Then Edit | Delete... |
Shift cells up | OK.

Hope this helps.

Pete

On Mar 7, 7:56*am, F. Lawrence Kulchar
wrote:

I wish to copy 2 columns of numbers as follows:

* * * * *A * * * * * * * * * * * * * B
1 * * *100 * * * * * * * * * * * * * * * * * *
2 * * * 50 * * * * * * * * * * * * * * *
3 * * * * * * * * * * * * * * * * * *85
4 * * * * * * * * * * * * * * * * * * * * *
5 * * * * * * * * * * * * * * * * * * * * * * *
6 * * * * * * * * * * * * * * * * * * *10
7 * * * *15 * * * * * * * * * * * * * * * *
9 * * * * * * * * * * * * * * * * * * *10
10 * * 20 * * * * * * * * * * * * * *20
11 * * * * * * * * * * * * * * * * * * 16

The PASTED TO cells will appear as follows:

* * * * * *A * * * * * * * * * * * * *B
*1 * * * 100 * * * * * * * * * * * *85
*2 * * * * 50 * * * * * * * * * * * * 10
*3 * * * *15 * * * * * * * * * * * * 10
*4 * * * * 20 * * * * * * * * * * * *20
*5 * * * * * * * * * * * * * * * * * *16

In other words, all occupied cells are filled in from top to bottom,
skipping all blanks.

How is this accomplished?

Thanks,

FLKulchar



FLKulchar

Skipping Blanks (Again)
 
I thought of this..however, in comes another problem...my blank cells are
not "blank" at all...there exists a formula where the value is "",
ergo...NOT 'blank' per se.

I performed a space special wherein I pasted values ONLY, but to no avail...

Any more suggestions, please??

Thanks,

FLKulchar
"Pete_UK" wrote in message
...
A rough and ready way would be to highlight columns A and B down to
the bottom-most value, then click on Edit | GoTo (or press F5), then
click Special and click on Blanks then OK. Then Edit | Delete... |
Shift cells up | OK.

Hope this helps.

Pete

On Mar 7, 7:56 am, F. Lawrence Kulchar
wrote:
I wish to copy 2 columns of numbers as follows:

A B
1 100
2 50
3 85
4
5
6 10
7 15
9 10
10 20 20
11 16

The PASTED TO cells will appear as follows:

A B
1 100 85
2 50 10
3 15 10
4 20 20
5 16

In other words, all occupied cells are filled in from top to bottom,
skipping all blanks.

How is this accomplished?

Thanks,

FLKulchar







All times are GMT +1. The time now is 05:08 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com