Find first non-empty cell ranght from column A
Hi Sige,
Try:
'=============
Public Sub Tester()
Dim rng As Range
Dim rng2 As Range
Dim rcell As Range
On Error Resume Next
Set rng = Intersect(ActiveSheet.UsedRange, Columns("A"))
Set rng2 = rng.SpecialCells(xlBlanks)
On Error GoTo 0
If Not rng2 Is Nothing Then
For Each rcell In rng2.Cells
With rcell
.Resize(1, 2) = .End(xlToRight).Value
End With
Next rcell
End If
End Sub
'<<=============
---
Regards,
Norman
"Sige" wrote in message
oups.com...
Hi There,
Could anyone help me with the following?
If a cell in Column A form my Usedrange (supposing that Usedrange
starts in Column A) is empty I would like to copy the first non-blank
cell from that row into column A.
E.g.
A B C
1 Y Y Y
2 - - Z
3 - K -
Should become:
YYY
Z-Z
KK-
Hope this makes sense,
Sige
|