single digit from a string

nehachoubey

Board Regular
Joined
Aug 17, 2011
Messages
52
Hi,
There is control string ('11111100000'). i have to get single digits from this string and enter into cells of sheet 'DATA' from cell E3 to O3. plz help !
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
Hi ,

Is this what you asked for?? I assumed that the string is stored in E3..
Code:
Private Sub ReplaceStr()
 
strTxt = Cells(3, 5).Value
Cells(3, 15).Value = strTxt
 
Cells(3, 15).Activate
        ActiveCell.Replace What:="0", Replacement:="", LookAt:=xlPart, _
        SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
        ReplaceFormat:=False
strTxt = Cells(3, 15).Value
msgbox strTxt
 
End Sub
 
Upvote 0
hI TRY THIS,

Code:
Private Sub SplitStr()
 
STRtXT = "11111100000"
 
For i = 15 To 5 Step -1
 
  Cells(3, i).Value = Right(STRtXT, 1)
  STRtXT = Left(STRtXT, Len(STRtXT) - 1)
 
Next i
 
End Sub
 
Upvote 0

Forum statistics

Threads
1,224,558
Messages
6,179,512
Members
452,921
Latest member
BBQKING

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