OS*Bomzer


Im working on some coding for an assignment i was given and i neede help as fast as possible. I have been recieving an error message that reads as follows:


Run-time error: "380"

Could not set the Value property: Invalid property value

Ive used F8 in attempt to locate the problem and i have highlighted where i believe the problem is in the coding below:

Dim Row As Integer
Dim nop As Integer
Dim cellc As Integer
Dim nosuppliers As Integer

Private Sub countchange_Change()

countchange.Max = txtnop + 1

txtcount.Text = countchange
Sheets("magazine").Select
Row = Val(txtcount) + 6

Range("A" & Row).Select
ctitle.Text = ActiveCell.FormulaR1C1

Range("B" & Row).Select
cissue.Text = ActiveCell.FormulaR1C1

Range("C" & Row).Select
cisbn.Text = ActiveCell.FormulaR1C1

Range("D" & Row).Select
cbuyprice.Text = ActiveCell.FormulaR1C1

Range("E" & Row).Select
csellprice.Text = ActiveCell.FormulaR1C1

Range("F" & Row).Select
cstockb.Text = ActiveCell.FormulaR1C1

Range("G" & Row).Select
cstocks.Text = ActiveCell.FormulaR1C1

Range("H" & Row).Select
cstockr.Text = ActiveCell.FormulaR1C1

Range("I" & Row).Select
csupplierno.Text = ActiveCell.FormulaR1C1

Range("J" & Row).Select
cinterval.Text = ActiveCell.FormulaR1C1

Range("K" & Row).Select
creleasedate.Text = ActiveCell.FormulaR1C1

Range("L" & Row).Select
cnreleasedate.Text = ActiveCell.FormulaR1C1

Range("M" & Row).Select
cgenre.Text = ActiveCell.FormulaR1C1

Range("N" & Row).Select
ccprofit.Text = ActiveCell.FormulaR1C1

Sheets("suppliers").Select
Row = Val(csupplierno) + 6
Range("c" & Row).Select
csupplierc = ActiveCell.FormulaR1C1

If txtcount > txtnop Then
csuppliername.ListIndex = 0

Else
Range("B" & Row).Select
csuppliername = ActiveCell.FormulaR1C1
End If

End Sub

Private Sub csuppliername_Change()
csupplierno = Val(csuppliername.ListIndex) + 1
Sheets("suppliers").Select
Row = Val(csupplierno) + 6
Range("c" & Row).Select
csupplierc = ActiveCell.FormulaR1C1
End Sub

Private Sub submit_Click()

Sheets("magazine").Select
Row = Val(txtcount) + 6

Range("A" & Row).Select
ActiveCell.FormulaR1C1 = ctitle.Text
ctitle.Text = ""

Range("B" & Row).Select
ActiveCell.FormulaR1C1 = cissue.Text
cissue.Text = ""

Range("C" & Row).Select
ActiveCell.FormulaR1C1 = cisbn.Text
cisbn.Text = ""

Range("D" & Row).Select
ActiveCell.FormulaR1C1 = cbuyprice.Text
cbuyprice.Text = ""

Range("E" & Row).Select
ActiveCell.FormulaR1C1 = csellprice.Text
csellprice.Text = ""

Range("F" & Row).Select
ActiveCell.FormulaR1C1 = cstockb.Text
cstockb.Text = ""

Range("G" & Row).Select
ActiveCell.FormulaR1C1 = cstocks.Text
cstocks.Text = ""

Range("H" & Row).Select
ActiveCell.FormulaR1C1 = cstockr.Text
cstockr.Text = ""

Range("I" & Row).Select
ActiveCell.FormulaR1C1 = csupplierno.Text
csupplierno.Text = ""

Range("J" & Row).Select
ActiveCell.FormulaR1C1 = cinterval.Text
cinterval.Text = ""

Range("K" & Row).Select
ActiveCell.FormulaR1C1 = creleasedate.Text
creleasedate.Text = ""

Range("L" & Row).Select
ActiveCell.FormulaR1C1 = cnreleasedate.Text
cnreleasedate.Text = ""

Range("M" & Row).Select
ActiveCell.FormulaR1C1 = cgenre.Text
cgenre.Text = ""

Range("N" & Row).Select
ActiveCell.FormulaR1C1 = ccprofit.Text
ccprofit.Text = ""

Range("O" & Row).Select
ActiveCell.FormulaR1C1 = txtcount.Text

txtcount = Val(txtcount) + 1
Row = Val(txtcount) + 6
Range("A" & Row).Select

countchange.Value = txtcount + 1
txtcount = countchange.Value

Range("C" & "2").Select
txtnop = ActiveCell.Value


End Sub

Private Sub UserForm_Initialize()

Sheets("magazine").Select

Row = 7

Range("A" & Row).Select
ctitle.Text = ActiveCell.FormulaR1C1

Range("B" & Row).Select
cissue.Text = ActiveCell.FormulaR1C1

Range("C" & Row).Select
cisbn.Text = ActiveCell.FormulaR1C1

Range("D" & Row).Select
cbuyprice.Text = ActiveCell.FormulaR1C1

Range("E" & Row).Select
csellprice.Text = ActiveCell.FormulaR1C1

Range("F" & Row).Select
cstockb.Text = ActiveCell.FormulaR1C1

Range("G" & Row).Select
cstocks.Text = ActiveCell.FormulaR1C1

Range("H" & Row).Select
cstockr.Text = ActiveCell.FormulaR1C1

Range("I" & Row).Select
csupplierno.Text = ActiveCell.FormulaR1C1

Range("J" & Row).Select
cinterval.Text = ActiveCell.FormulaR1C1

Range("K" & Row).Select
creleasedate.Text = ActiveCell.FormulaR1C1

Range("L" & Row).Select
cnreleasedate.Text = ActiveCell.FormulaR1C1

Range("M" & Row).Select
cgenre.Text = ActiveCell.FormulaR1C1

Range("N" & Row).Select
ccprofit.Text = ActiveCell.FormulaR1C1

Range("C" & "2").Select
txtnop = ActiveCell.Value
Sheets("suppliers").Select
Row = 7
Range("C" & "2").Select
nosuppliers = ActiveCell.Value
Range("B" & Row).Select
cellc = 0
Do While cellc <= nosuppliers
csuppliername.AddItem (ActiveCell.FormulaR1C1)
cellc = cellc + 1
Row = Row + cellc
Range("B" & Row).Select
Loop

Sheets("suppliers").Select
Row = Val(csupplierno) + 6
Range("c" & Row).Select
csupplierc = ActiveCell.FormulaR1C1
Range("B" & Row).Select
csuppliername = ActiveCell.FormulaR1C1

countchange.Max = Val(txtnop) + 1

End Sub


If you need any more info on the program dont hesitate to ask. Please try to help me.




Re: Error 380: Invalid property value:Help Me Please

extremeb


"Row = Val(csupplierno) + 6"

is this the line that VBA highlighted when u clicked on the 'debug' button

is 'csupplierno' a textbox because i cant see any declaration for it

i know it may sound stupid, but can u rename 'Row' to something else say 'row_no', im just worry that 'Row' might be some system variables.

thanks.