Troubleshoot Excel VBA Code Based on Queries

Опубликовано: 30 Сентябрь 2024
на канале: Dinesh Kumar Takyar
1,064
5

Our Excel training videos on YouTube cover formulas, functions and VBA. Useful for beginners as well as advanced learners. New upload every Thursday.
For details you can visit our website:
http://www.familycomputerclub.com
Two Excel VBA queries and their solution:
1. Code in the following video not working:
Transfer data from one Excel worksheet to another automatically
   • Transfer data from one Excel workshee...  
2. Not working VBA code for combo box and userform
Hi Sir,
I have found out your video while trying to search on how to create a userform to enter data. However, I had followed your code but it is not working as it seems in your video. I am not sure where has it gone wrong and can you please help me out. my code is as below:

Private Sub btnenterorder_Click()
Dim RowCount As Long

If Not IsNumeric(Me.tbquantity.Value) Then
MsgBox "The Quantity box must contain a number.", vbExclamation
Me.tbquantity.SetFocus
End If

RowCount = Worksheets("Record Customers").Range("F15").CurrentRegion.Rows.Count
With Worksheets("Record Customers").Range("F15")
.Offset(RowCount, 0) = Me.cmborderdays.Value
.Offset(RowCount, 2) = Me.cmbnewspapertype.Value
.Offset(RowCount, 4) = Me.tbquantity.Value

End With
End Sub


The data is only input in cell F19, J19 and L19. It then gets stuck there and even if i enter new information it only changes the data in cell F19, J9 and L19.

I need the data to be input in cell F15, J15 and L15 onwards.

I would really appreciate your help. My email is [email protected] and please email to me the solution. If you need further clarification, please email me so I can show you a screenshot of the error.

Thanks so much!

Doreen Chng

More details available at: http://www.familycomputerclub.com/Tro...