Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi
I need some opinions. I got a text file loaded into a text box and a combo box which has several integer values. When a user choose a value from the combo box, e.g. 3, I want to be able to group the characters from the text file into 3 characters where each cell consists of one character. The sample of the text file looks like this: WUBEFIQLZURMVOFEHMYMWTIXCGTMPIFKRZUPMVOIRQMMWOZM And when the user choose the number from the combo box,e.g. 3 I want the cell to contain: W U B E F I Q L Z U R M V O F and so forth I have this line of codes but I wander if there's a better way of doin it? Private Sub KeyLengthComboBox_Change() Worksheets("Sheet9").Activate Dim myChar keylength = CInt(KeyLengthComboBox) For k = 1 To CipherTextBox.TextLength myChar = Mid(CipherTextBox.Text, k, 1) If k Mod keylength = 0 Then Worksheets("sheet9").Cells(Int(k / keylength), keylength) myChar Else Worksheets("sheet9").Cells(Int(k / keylength) + 1, k Mo keylength) = myChar End If Next k End Sub Many thanks did -- Message posted from http://www.ExcelForum.com |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Split text file into Excel sheet and separate the final results intoa new sheet | Excel Worksheet Functions | |||
Split text to multiple cells | Excel Worksheet Functions | |||
split text into separate cells | Excel Worksheet Functions | |||
Can text in one cell be split into several cells? | Excel Discussion (Misc queries) | |||
text cells end page how split to next. Text lost! | Excel Discussion (Misc queries) |