View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Ardy Ardy is offline
external usenet poster
 
Posts: 136
Default Transfering Info Stop When Null

Hello All:
I am trying to transfer some data from Column A in Tab A to Column A in
TAB B. I also Am trying to make the code stop if it encounters null.
Meaning don't auto fill, but not having any luck. Can somebody take
a look at the code and put me in the right direction or tell me what I
have done wrong.
---------------------------
Sub StudentNameTransfer()
Sheets("PA-DWR Detail").Select
' ActiveWorkbook.Worksheets("Roster").Unprotect "LasAnimas"
Range("A3").Select
ActiveCell.FormulaR1C1 = "=(Roster!R[-1]C)" ' This is the first
name
' I like to stop the autofill if it hits a null from the other tab
in another word if it is null it will 'transfer a 0 I just assume it
stops because it means we don't have any data

With ActiveSheet
LastRow = .Cells(.Rows.Count, "A").End(xlUp).Row
.Range("A3:A44").AutoFill Destination:=.Range("A3:A" & LastRow), _
Type:=xlFillDefault
End With
Sheets("Roster").Select
Range("B2").Select
End Sub
---------------------------
Thanks