ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Darn function in vba (https://www.excelbanter.com/excel-programming/361558-darn-function-vba.html)

Jennifer

Darn function in vba
 
Not sure why this is proving to me so hard, what is wrong with this

wks.Cells(iRow, 4).Value = "= S & cboStallion)"

cboStallion is my combo box, i want it to fill in the database looking
something like:
S6
--
Though daily learning, I LOVE EXCEL!
Jennifer

Greg Wilson

Darn function in vba
 
Assuming the combobox is userform based:

wks.Cells(iRow, 4).Value = "S" & cboStallion.Value

The main problem was that Excel thinks an entry preceeded with an equals
sign (=) is a formula. It therefore calculates it which raises an error.

You should also have excluded the combo's value from the quotations when
concatenating. Inclusion of the leading equals sign when adding text to a
cell is for intentionally adding a formula. I don't know what the single
right parentheses was for. Typo I assume.

Regards,
Greg

"Jennifer" wrote:

Not sure why this is proving to me so hard, what is wrong with this

wks.Cells(iRow, 4).Value = "= S & cboStallion)"

cboStallion is my combo box, i want it to fill in the database looking
something like:
S6
--
Though daily learning, I LOVE EXCEL!
Jennifer


Jennifer

Darn function in vba
 
Thank you much!
--
Though daily learning, I LOVE EXCEL!
Jennifer


"Greg Wilson" wrote:

Assuming the combobox is userform based:

wks.Cells(iRow, 4).Value = "S" & cboStallion.Value

The main problem was that Excel thinks an entry preceeded with an equals
sign (=) is a formula. It therefore calculates it which raises an error.

You should also have excluded the combo's value from the quotations when
concatenating. Inclusion of the leading equals sign when adding text to a
cell is for intentionally adding a formula. I don't know what the single
right parentheses was for. Typo I assume.

Regards,
Greg

"Jennifer" wrote:

Not sure why this is proving to me so hard, what is wrong with this

wks.Cells(iRow, 4).Value = "= S & cboStallion)"

cboStallion is my combo box, i want it to fill in the database looking
something like:
S6
--
Though daily learning, I LOVE EXCEL!
Jennifer


Greg Wilson

Darn function in vba
 
Thanks for the thanks. I appreciate the feedback.

Greg

"Jennifer" wrote:

Thank you much!
--
Though daily learning, I LOVE EXCEL!
Jennifer


"Greg Wilson" wrote:

Assuming the combobox is userform based:

wks.Cells(iRow, 4).Value = "S" & cboStallion.Value

The main problem was that Excel thinks an entry preceeded with an equals
sign (=) is a formula. It therefore calculates it which raises an error.

You should also have excluded the combo's value from the quotations when
concatenating. Inclusion of the leading equals sign when adding text to a
cell is for intentionally adding a formula. I don't know what the single
right parentheses was for. Typo I assume.

Regards,
Greg

"Jennifer" wrote:

Not sure why this is proving to me so hard, what is wrong with this

wks.Cells(iRow, 4).Value = "= S & cboStallion)"

cboStallion is my combo box, i want it to fill in the database looking
something like:
S6
--
Though daily learning, I LOVE EXCEL!
Jennifer



All times are GMT +1. The time now is 02:53 AM.

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