ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Missing Comma (https://www.excelbanter.com/excel-discussion-misc-queries/61990-missing-comma.html)

mully

Missing Comma
 
Hi All --- Seasons Greetings,

I have a UserForm with a drop down Combo Box some of the code is below the
problem I have is that the Comma after the number disappears when entering
the sheet cell --- unfortunately the Comma is part of a unique identifier
that I use to get information --- Question is what do I do to make it appear
in the cell.


ComCode.Value = "Select Code"
ComCode.AddItem " 4100, "
ComCode.AddItem " 4013, "

Any help much appreciated

Cheers

Mully

Dave Peterson

Missing Comma
 
Format the cell as text first.

dim myCell as range
set mycell = activesheet.range("a1") 'whatever you need

with mycell
.numberformat = "@" 'Text
.value = comcode.value
end with

Or prefix it with an apostrophe:

mycell.value = "'" & comcode.value



mully wrote:

Hi All --- Seasons Greetings,

I have a UserForm with a drop down Combo Box some of the code is below the
problem I have is that the Comma after the number disappears when entering
the sheet cell --- unfortunately the Comma is part of a unique identifier
that I use to get information --- Question is what do I do to make it appear
in the cell.

ComCode.Value = "Select Code"
ComCode.AddItem " 4100, "
ComCode.AddItem " 4013, "

Any help much appreciated

Cheers

Mully


--

Dave Peterson

mully

Missing Comma
 
Hi Dave

Thanks for the info --- worked 1st time perfectly --- just one query??
instead of activesheet on line below -- is it possible to specify a
particular sheet in the Workbook.

set mycell = activesheet.range("a1") 'whatever you need

Once again Thank you

Cheers

Mully


"Dave Peterson" wrote:

Format the cell as text first.

dim myCell as range
set mycell = activesheet.range("a1") 'whatever you need

with mycell
.numberformat = "@" 'Text
.value = comcode.value
end with

Or prefix it with an apostrophe:

mycell.value = "'" & comcode.value



mully wrote:

Hi All --- Seasons Greetings,

I have a UserForm with a drop down Combo Box some of the code is below the
problem I have is that the Comma after the number disappears when entering
the sheet cell --- unfortunately the Comma is part of a unique identifier
that I use to get information --- Question is what do I do to make it appear
in the cell.

ComCode.Value = "Select Code"
ComCode.AddItem " 4100, "
ComCode.AddItem " 4013, "

Any help much appreciated

Cheers

Mully


--

Dave Peterson


Dave Peterson

Missing Comma
 
Sure.

set mycell = worksheets("whateveryouwanthere").range("a1")

And if you wanted to use the next available cell in column A of sheet99, you
could use something like:

With worksheets("sheet99")
set mycell = .cells(.rows.count,"A").end(xlup).offset(1,0)
end with



mully wrote:

Hi Dave

Thanks for the info --- worked 1st time perfectly --- just one query??
instead of activesheet on line below -- is it possible to specify a
particular sheet in the Workbook.

set mycell = activesheet.range("a1") 'whatever you need

Once again Thank you

Cheers

Mully

"Dave Peterson" wrote:

Format the cell as text first.

dim myCell as range
set mycell = activesheet.range("a1") 'whatever you need

with mycell
.numberformat = "@" 'Text
.value = comcode.value
end with

Or prefix it with an apostrophe:

mycell.value = "'" & comcode.value



mully wrote:

Hi All --- Seasons Greetings,

I have a UserForm with a drop down Combo Box some of the code is below the
problem I have is that the Comma after the number disappears when entering
the sheet cell --- unfortunately the Comma is part of a unique identifier
that I use to get information --- Question is what do I do to make it appear
in the cell.

ComCode.Value = "Select Code"
ComCode.AddItem " 4100, "
ComCode.AddItem " 4013, "

Any help much appreciated

Cheers

Mully


--

Dave Peterson


--

Dave Peterson

mully

Missing Comma
 
Hi Dave

Thanks worked spot --- I've got 23 sheets that use the info all in column A
and all with a different code number -- at the moment just using cut and
paste takes time but I manage -- your info cut working time by about 3 Hours.

Thanks again

Mully

"Dave Peterson" wrote:

Sure.

set mycell = worksheets("whateveryouwanthere").range("a1")

And if you wanted to use the next available cell in column A of sheet99, you
could use something like:

With worksheets("sheet99")
set mycell = .cells(.rows.count,"A").end(xlup).offset(1,0)
end with



mully wrote:

Hi Dave

Thanks for the info --- worked 1st time perfectly --- just one query??
instead of activesheet on line below -- is it possible to specify a
particular sheet in the Workbook.

set mycell = activesheet.range("a1") 'whatever you need

Once again Thank you

Cheers

Mully

"Dave Peterson" wrote:

Format the cell as text first.

dim myCell as range
set mycell = activesheet.range("a1") 'whatever you need

with mycell
.numberformat = "@" 'Text
.value = comcode.value
end with

Or prefix it with an apostrophe:

mycell.value = "'" & comcode.value



mully wrote:

Hi All --- Seasons Greetings,

I have a UserForm with a drop down Combo Box some of the code is below the
problem I have is that the Comma after the number disappears when entering
the sheet cell --- unfortunately the Comma is part of a unique identifier
that I use to get information --- Question is what do I do to make it appear
in the cell.

ComCode.Value = "Select Code"
ComCode.AddItem " 4100, "
ComCode.AddItem " 4013, "

Any help much appreciated

Cheers

Mully

--

Dave Peterson


--

Dave Peterson



All times are GMT +1. The time now is 03:59 PM.

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