Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Why it doesn't work
Hi,
Why this code stop always at the last not empty line (7269). The data is at line 6839. Any tought. Dim Line As Integer For u = 2 To .Range("A65536").End(xlUp).Row If .Cells(u, 1) = Me.Combo1.Text And .Cells(u, 2) = Me.Combo2.Text And ..Cells(u, 3) = Me.Combo3.Text And .Cells(u, 4) = Me.Combo4.Text Then Line = u Exit Sub End If Next Thanks |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Why it doesn't work
Maybe there's a difference between what's in the comboboxes and what's in those
cells--upper/lower case differences, spelling differences, differences in spaces???? "François" wrote: Hi, Why this code stop always at the last not empty line (7269). The data is at line 6839. Any tought. Dim Line As Integer For u = 2 To .Range("A65536").End(xlUp).Row If .Cells(u, 1) = Me.Combo1.Text And .Cells(u, 2) = Me.Combo2.Text And .Cells(u, 3) = Me.Combo3.Text And .Cells(u, 4) = Me.Combo4.Text Then Line = u Exit Sub End If Next Thanks -- Dave Peterson |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Why it doesn't work
No differences, the datas in the comboboxes are the same than de cells.
Thanks for you help. "Dave Peterson" a écrit dans le message de news: ... Maybe there's a difference between what's in the comboboxes and what's in those cells--upper/lower case differences, spelling differences, differences in spaces???? "François" wrote: Hi, Why this code stop always at the last not empty line (7269). The data is at line 6839. Any tought. Dim Line As Integer For u = 2 To .Range("A65536").End(xlUp).Row If .Cells(u, 1) = Me.Combo1.Text And .Cells(u, 2) = Me.Combo2.Text And .Cells(u, 3) = Me.Combo3.Text And .Cells(u, 4) = Me.Combo4.Text Then Line = u Exit Sub End If Next Thanks -- Dave Peterson |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Why it doesn't work
Here what I have :
Private Sub CmdOK_Click() Dim Line As Integer Dim u As Integer With Sheets("Inventory") For u = 2 To .Range("A65536").End(xlUp).Row If .Cells(u, 1) = Me.Combo1.Text Then Debug.Print .Cells(u, 1).Value & vbLf & Me.Combo1.Text 'u =7414, Combo1 = w If .Cells(u, 2) = Me.Combo2.Text Then Debug.Print .Cells(u, 1).Value & vbLf & Me.Combo1.Text 'u =7414, Combo2 = x If .Cells(u, 3) = Me.Combo3.Text Then Debug.Print .Cells(u, 1).Value & vbLf & Me.Combo1.Text 'u =7414, Combo3 = y If .Cells(u, 4) = Me.Combo4.Text Then Debug.Print .Cells(u, 1).Value & vbLf & Me.Combo1.Text 'u =7414, Combo4 = z Line = u Exit Sub End If End If End If End If Next "Dave Peterson" a écrit dans le message de news: ... Add some debug.print lines to verify--I bet there's a difference. debug.print .cells(u,1).value & vblf & me.combo1.text then look for the differences in the immediate window. "François" wrote: No differences, the datas in the comboboxes are the same than de cells. Thanks for you help. "Dave Peterson" a écrit dans le message de news: ... Maybe there's a difference between what's in the comboboxes and what's in those cells--upper/lower case differences, spelling differences, differences in spaces???? "François" wrote: Hi, Why this code stop always at the last not empty line (7269). The data is at line 6839. Any tought. Dim Line As Integer For u = 2 To .Range("A65536").End(xlUp).Row If .Cells(u, 1) = Me.Combo1.Text And .Cells(u, 2) = Me.Combo2.Text And .Cells(u, 3) = Me.Combo3.Text And .Cells(u, 4) = Me.Combo4.Text Then Line = u Exit Sub End If Next Thanks -- Dave Peterson -- Dave Peterson |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
Why it doesn't work
I think I would have used all the fields:
for u = 2 to .... Debug.print "==========" & u & "====" Debug.Print "1: " & .Cells(u, 1).Value & "|" & Me.Combo1.Text Debug.Print "2: " & .Cells(u, 2).Value & "|" & Me.Combo2.Text Debug.Print "3: " & .Cells(u, 3).Value & "|" & Me.Combo3.Text Debug.Print "4: " & .Cells(u, 4).Value & "|" & Me.Combo4.Text Debug.Print "==============" 'and comment out the other stuff next u And if you know a row that is exactly the same start the for u = 2342 to 2345 'say "François" wrote: Here what I have : Private Sub CmdOK_Click() Dim Line As Integer Dim u As Integer With Sheets("Inventory") For u = 2 To .Range("A65536").End(xlUp).Row If .Cells(u, 1) = Me.Combo1.Text Then Debug.Print .Cells(u, 1).Value & vbLf & Me.Combo1.Text 'u =7414, Combo1 = w If .Cells(u, 2) = Me.Combo2.Text Then Debug.Print .Cells(u, 1).Value & vbLf & Me.Combo1.Text 'u =7414, Combo2 = x If .Cells(u, 3) = Me.Combo3.Text Then Debug.Print .Cells(u, 1).Value & vbLf & Me.Combo1.Text 'u =7414, Combo3 = y If .Cells(u, 4) = Me.Combo4.Text Then Debug.Print .Cells(u, 1).Value & vbLf & Me.Combo1.Text 'u =7414, Combo4 = z Line = u Exit Sub End If End If End If End If Next "Dave Peterson" a écrit dans le message de news: ... Add some debug.print lines to verify--I bet there's a difference. debug.print .cells(u,1).value & vblf & me.combo1.text then look for the differences in the immediate window. "François" wrote: No differences, the datas in the comboboxes are the same than de cells. Thanks for you help. "Dave Peterson" a écrit dans le message de news: ... Maybe there's a difference between what's in the comboboxes and what's in those cells--upper/lower case differences, spelling differences, differences in spaces???? "François" wrote: Hi, Why this code stop always at the last not empty line (7269). The data is at line 6839. Any tought. Dim Line As Integer For u = 2 To .Range("A65536").End(xlUp).Row If .Cells(u, 1) = Me.Combo1.Text And .Cells(u, 2) = Me.Combo2.Text And .Cells(u, 3) = Me.Combo3.Text And .Cells(u, 4) = Me.Combo4.Text Then Line = u Exit Sub End If Next Thanks -- Dave Peterson -- Dave Peterson -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Macro to update a column in a work based on another work sheet | New Users to Excel | |||
how can i automatically generate work order numbers from work orde | Excel Discussion (Misc queries) | |||
If I have a work sheet protected and try to run a macro to hide rows or columns it won't work. Correct? | Excel Programming | |||
Counting dates in multiple work sheets and work books | Excel Discussion (Misc queries) | |||
Is there away to keep "auto save" from jumping to the first work sheet in the work book? | New Users to Excel |