View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default GCSE Student in a spot of trouble

Remove the line:
Sub Button1_Click()

So it should just look like this:

Private Sub CommandButton1_Click()
Dim iRow As Long


For i = 6 To Me.Rows.Count
If Me.Cells(i, 5) = "" Then
Me.Cells(i, 5) = i - 5
Me.Cells(i, 6) = Me.Cells(2, 6)
Me.Cells(i, 7) = Me.Cells(2, 7)
Me.Cells(i, 8) = Me.Cells(2, 8)
Me.Cells(i, 9) = Me.Cells(2, 9)
Me.Cells(i, 10) = Me.Cells(2, 10)
End If
Next i
End Sub

--
Regards,
Tom Ogilvy

"WindJackal" wrote in message
...

Im a GCSE student doing an advanced course in which i have to create my
own magagment system of a company, i really need help with this button
i need to create, inclosed is a screentshot of my XLS and a copy of the
macros already programmed by a friend, problem is the macros dont seem
to work so if n e body could correct it that would be great!
'Screenshot' (http://geocities.com/dumponthelawn/screenshot.PNG)

Sub Button1_Click()
Private Sub CommandButton1_Click()
Dim iRow As Long


For i = 6 To Me.Rows.Count
If Me.Cells(i, 5) = "" Then
Me.Cells(i, 5) = i - 5
Me.Cells(i, 6) = Me.Cells(2, 6)
Me.Cells(i, 7) = Me.Cells(2, 7)
Me.Cells(i, 8) = Me.Cells(2, 8)
Me.Cells(i, 9) = Me.Cells(2, 9)
Me.Cells(i, 10) = Me.Cells(2, 10)
End If
Next i
End Sub



--
WindJackal
------------------------------------------------------------------------
WindJackal's Profile:

http://www.excelforum.com/member.php...o&userid=14569
View this thread: http://www.excelforum.com/showthread...hreadid=261966