ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   New Users to Excel (https://www.excelbanter.com/new-users-excel/)
-   -   Please help correct a simple error (https://www.excelbanter.com/new-users-excel/4621-please-help-correct-simple-error.html)

lwhite

Please help correct a simple error
 
I am trying to place a value into a string and then
place that value in a cell. I don't what I did wrong but
I am sure it is simple code. This happens in a
CommandButton. I have a combo box on the sheet that has a
drop down list in it. I select the item and then click
the button. I select the cell, place the vlaue and then
select another cell. That is it. I am building towards a
larger total function for the button.

Dim myDesc As String

Set myDesc = Me.ComboBox2

Sheets("Quote").Select
Range("J17").Select
Range("J17").Value = myDesc

Sheets("Quote").Select
Range("G17").Select

Art

Try this:

Sub temp()
Dim x As ComboBox
Set x = Me.ComboBox1
Range("A2") = x
Range("B7").Select
End Sub

Art


All times are GMT +1. The time now is 10:54 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com