ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   GCSE Student in a spot of trouble (https://www.excelbanter.com/excel-programming/310708-gcse-student-spot-trouble.html)

WindJackal

GCSE Student in a spot of trouble
 

Im a GCSE student doing an advanced course in which i have to create m
own magagment system of a company, i really need help with this butto
i need to create, inclosed is a screentshot of my XLS and a copy of th
macros already programmed by a friend, problem is the macros dont see
to work so if n e body could correct it that would be great! :cool:
'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



--
WindJacka
-----------------------------------------------------------------------
WindJackal's Profile: http://www.excelforum.com/member.php...fo&userid=1456
View this thread: http://www.excelforum.com/showthread.php?threadid=26196


Tom Ogilvy

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! :cool:
'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





All times are GMT +1. The time now is 04:21 AM.

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