View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Biff Biff is offline
external usenet poster
 
Posts: 1,688
Default If one column is full, goto the next column

Hi Folks!

I found this code by Gord Dibben:

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
On Error GoTo stoppit
If Target.Address = "$A$2" And Target.Value < "" Then
ActiveSheet.Cells(Rows.Count, 2).End(xlUp) _
.Offset(1, 0).Value = Target.Value
End If
stoppit:
End Sub

It's event code that "copies" the value entered in A2 to another column
(B2:Bn).

Can this code be modified so that if column B (or whatever column) is full:
=COUNTA(B:B)=65536, then it starts putting the values in the next column to
the right and continues in this fashion?

Thanks!

Biff