![]() |
|
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Join Date: Feb 2004
Location: Canada
Posts: 49
|
I need help in how to write a simple code to operate a zoop function. I have a invoice that I use a userform to enter in parts numbers. I would like it to zoop down the row till it finds the first open cell. It would search Row E55 to E68 and input the userform value. Once all the cells are full it would state so. Here is the code I am using to get the information to the invoice:
Private Sub CommandButton2_Click() Worksheets("Order Form").Range("E55") = UserForm7.ComboBox1.Value End Sub Now what?? Thanks |
|
|
|
|
|
#2 |
|
Join Date: Sep 2003
Location: NJ
Posts: 666
|
you talk about "down the row" but I assume you mean down the column.
try this: Code:
Private Sub CommandButton2_Click()
Dim tgt
With Sheets("Order Form")
With Range("e65536")
tgt = .End(xlUp).Offset(1, 0).Row
If tgt < 55 Then tgt = 55
If tgt > 68 Then
MsgBox "Range is full"
Exit Sub
Else
Cells(tgt, 5) = ComboBox1
End If
End With
End With
End Sub
__________________
-Bob [XL2003 on XP] Slowly coming out of the Stone Age and trying to trade in my abacus. |
|
|
|
|
|
#3 |
|
Join Date: Feb 2004
Location: Canada
Posts: 49
|
You are right I meant columns. When I applied your code it did not input the information into the Column E55 to E68 but did give me a message that the range was full even though no information was entered. Any ideas as I am only learning code.
Thanks again Rookie |
|
|
|
|
|
#4 | |
|
Join Date: Sep 2003
Location: NJ
Posts: 666
|
Quote:
Change the line: With Range("e65536") to: With Range("e69") and that should correct this.
__________________
-Bob [XL2003 on XP] Slowly coming out of the Stone Age and trying to trade in my abacus. |
|
|
|
|
|
|
#5 |
|
Join Date: Feb 2004
Location: Canada
Posts: 49
|
Thanks that is exactly what it needed. Hope you have a great day I will thanks to your help.
KH |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|