ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   New Users to Excel (https://www.excelbanter.com/new-users-excel/)
-   -   help with if statement (https://www.excelbanter.com/new-users-excel/154981-help-if-statement.html)

Shane

help with if statement
 
I need help on my if statement.

I am populating selected cells in a spreadsheet by use of a userform.
The polulating works great. I would like to adjust my code so that if
no value is selected from from the combobox then the target cell will
retain its original value/formula. Any help would be great

Here is what I have so far.

If ComboBox_Sub.Value Is Nothing Then
?????
Else
Cells(r, 11) = ComboBox_Sub.Value
End If

Shane


JE McGimpsey

help with if statement
 
One way:

If Combobox_Sub.Value < vbNullString Then _
Cells(r, 11) = Combobox_Sub.Value


In article .com,
Shane wrote:

I need help on my if statement.

I am populating selected cells in a spreadsheet by use of a userform.
The polulating works great. I would like to adjust my code so that if
no value is selected from from the combobox then the target cell will
retain its original value/formula. Any help would be great

Here is what I have so far.

If ComboBox_Sub.Value Is Nothing Then
?????
Else
Cells(r, 11) = ComboBox_Sub.Value
End If

Shane


Shane

help with if statement
 
That worked, thanks



On Aug 20, 12:56 pm, JE McGimpsey wrote:
One way:

If Combobox_Sub.Value < vbNullString Then _
Cells(r, 11) = Combobox_Sub.Value

In article .com,



Shane wrote:
I need help on my if statement.


I am populating selected cells in a spreadsheet by use of a userform.
The polulating works great. I would like to adjust my code so that if
no value is selected from from the combobox then the target cell will
retain its original value/formula. Any help would be great


Here is what I have so far.


If ComboBox_Sub.Value Is Nothing Then
?????
Else
Cells(r, 11) = ComboBox_Sub.Value
End If


Shane- Hide quoted text -


- Show quoted text -





All times are GMT +1. The time now is 06:17 AM.

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