Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #3  
Old 10-30-2017, 12:12 PM
FionaMcKenzie FionaMcKenzie is offline Convert Text to Num from ComboBox.Addme to Excel Windows 10 Convert Text to Num from ComboBox.Addme to Excel Office 2016
Novice
 
Join Date: Oct 2017
Location: Surrey, United Kingdom
Posts: 14
FionaMcKenzie is on a distinguished road
Default

You probably haven't declared your variables as a Long.

This should help as a code stub to understand what you have done wrong?

Option Explicit

Private Sub CommandButton1_Click()

Dim lComboBox As Long, lCombBoxCount As Long

lCombBoxCount = Me.ComboBox1.ListCount - 1

With ActiveSheet
For lComboBox = 0 To lCombBoxCount
.Cells(lComboBox + 1, 1).Value = Me.ComboBox1.List(lComboBox)
Next lComboBox
End With
End Sub

Private Sub UserForm_Initialize()

Dim lComboBox As Long

Me.ComboBox1.Clear

For lComboBox = 1 To 10
Me.ComboBox1.AddItem lComboBox
Next lComboBox

End Sub
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Convert Text to Num from ComboBox.Addme to Excel Excel Combobox List VBA-User Excel Programming 4 01-07-2016 02:46 AM
Convert Text to Num from ComboBox.Addme to Excel Using combobox to pass data from an Excel spread sheet to text boxes on userform Stewie840 Word VBA 14 12-17-2015 10:13 PM
Convert Text to Num from ComboBox.Addme to Excel How to convert a text file to an Excel file with the data format automatically? mradmin Excel 6 10-16-2013 10:34 AM
Convert Text to Num from ComboBox.Addme to Excel Convert lists of text in Word to excel Grosspsych Excel 5 02-06-2012 08:03 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 09:04 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft