Values Unrecognizable After Update Userform

mucah!t

Well-known Member
Joined
Jun 27, 2009
Messages
593
Hi all,

The following code edits/adds the value of textbox2 to its corresponding cell.
The problem with it is that after updating, the values are unrecognizable and can't be used for further calculations.

Code:
    With LB
        LI = .ListIndex
        Range(.ListFillRange).Cells(LI + 1, 2).Value = TextBox2.Value
        .ListFillRange = .ListFillRange
        .ListIndex = LI
    End With

- Texttocolumns solves the problem, but recording it results in an error.
- Google offered the following solution:

Code:
Worksheets("Database").Columns("J").TextToColumns Destination:=Range("J1"), FieldInfo:=Array(1, 1)

Although it does not gives an error it makes even more values in the column unrecognizable.

Perhaps the problem can be solved in the way the value is updated in the first place instead of fixing it afterwards.

Any ideas?
 
I only suggested using Val.

How can putting one value in a cell change all these others?

Is there anything else going on?
 
Upvote 0

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
There was indeed some other code crating the problem.
Then only one thing remains Val(Textbox2.Value) removes numbers after the decimal.
I tried the following but it resulted in an error.


Code:
Dim Value as Double

    With LB
        LI = .ListIndex
        Range(.ListFillRange).Cells(LI + 1, 10).Value= Val(TextBox10.value)
        .ListFillRange = .ListFillRange
        .ListIndex = LI
    End With
 
Upvote 0
What's the purpose of .ListFillRange = .ListFillRange?

Is it meant to update the list.

By the way Value is a very bad name for a variable, Value is a property of lots of things in Excel/VBA.
 
Upvote 0

Forum statistics

Threads
1,224,612
Messages
6,179,890
Members
452,948
Latest member
Dupuhini

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top