hi All
The below code is giving me a mis-match error, this is something i have copied and tried to mod to fit for use
what i am trying to do is for ever row that has a -1 this is entered by another macro, i want just these rows to appear in my listbox
When i have this up i want to highlight a number and i press the button below i want to fill data against this
then re-run this again untill all the "-1" are all gone
any one got any idea's!! i'm going crazy looking at it!!!
The below code is giving me a mis-match error, this is something i have copied and tried to mod to fit for use
what i am trying to do is for ever row that has a -1 this is entered by another macro, i want just these rows to appear in my listbox
Code:
Private Sub UserForm_Initialize()
Dim wk As Workbook
Dim ws1 As Worksheet
Set wk = ThisWorkbook
Set ws1 = wk.Sheets("Sheet1")
Dim rCopy As Range
Dim c As Integer
Dim r As Integer
With Sheets("Sheet1").Select
c = Range("a1").End(xlToRight).Column
r = Cells(Rows.Count, c).End(xlUp).Row
End With
'Set rCopy = Range(Cells(1, 3), Cells(r, 8))
For r = 1 To r
'ws1.Cells(r, 37).Value = "-1"
Me.ListBox1.RowSource = ws1.Cells(r, 37) = "-1" ' rCopy.Address
Next r
End Sub
When i have this up i want to highlight a number and i press the button below i want to fill data against this
Code:
Private Sub cmdOkay_Click()Dim wk As Workbook
Dim the_sheet As Worksheet
Dim uf6 As UserForm
Dim combob1 As ComboBox
Dim combob2 As ComboBox
Set the_sheet = Sheets("Sheet1")
Set uf6 = UserForm2
Set wk = ThisWorkbook
Set combob1 = Me.ComboBox1
Set combob2 = Me.ComboBox2
Range("AC" & (ActiveCell.Row)) = Right(combob1.Value, 4)
Range("AE" & (ActiveCell.Row)) = combob2.Value
Range("AL" & (ActiveCell.Row)) = "0"
Range("AK" & (ActiveCell.Row)).Clear
UserForm6.Hide
Call RouteVal3
End Sub
then re-run this again untill all the "-1" are all gone
any one got any idea's!! i'm going crazy looking at it!!!