We help IT Professionals succeed at work.

Check out our new AWS podcast with Certified Expert, Phil Phillips! Listen to "How to Execute a Seamless AWS Migration" on EE or on your favorite podcast platform. Listen Now

x

Maintain original data format during update

Cartillo
Cartillo asked
on
Medium Priority
230 Views
Last Modified: 2012-05-11
Hi Experts,

I would like to request Experts help. How to prevent the TextBox1 (attached script) at Userform2 doesn’t modify  the actual data format while updating the content.  The userform 2 activated when double click at column J or K for data update. E.g. data at cell J44 and K44 got deleted when update the data via userform. Hope Experts will help me to prevent the original data and the format were distracted while update/amend the content.  



Option Explicit

Private Sub CommandButton1_Click()
    Dim MyArray() As String
    MyArray = Split(Me.TextBox1.Value, vbCrLf)
    
    Sheets("Daily Tracking List").Cells(Selection.Row, "J").Value = Trim(Replace(MyArray(0), "Issues:", ""))
    
    Sheets("Daily Tracking List").Cells(Selection.Row, "K").Value = Trim(Replace(MyArray(2), "Findings/Updates:", ""))
    Unload Me
End Sub

Private Sub CommandButton2_Click()
    Sheets("Daily Tracking List").Cells(Selection.Row, "J").ClearContents
    Sheets("Daily Tracking List").Cells(Selection.Row, "K").ClearContents
    Unload Me
End Sub


Private Sub UserForm_Initialize()
With Me.TextBox1
    .WordWrap = True
    .MultiLine = True
End With
With Sheets("Daily Tracking List")
    Me.TextBox1.Value = "Issues: " & .Cells(Selection.Row, "J") & vbCrLf & vbCrLf & _
        "Findings/Updates: " & .Cells(Selection.Row, "K")
End With
End Sub

Open in new window

DataEntry.xls
Comment
Watch Question

Unlock this solution with a free trial preview.
(No credit card required)
Get Preview

Author

Commented:
Hi Sid,

The data got updated except for data with “Bullet Library” or “numbering library”. Most of the time the actual data was copied over from words document for compilation. Hope we can salvage this object as well while updating the data.
>>>The data got updated except for data with “Bullet Library” or “numbering library”.

Which cell are you referring to?

Sid

Author

Commented:
Thanks Sid for the help
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a free trial preview!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.