[RESOLVED] FlexGrid Format Cell's
Hi
I want to format the ComboBox text which placing over the FlexGrid
The result will show in FG2 cell in .Col 18 like that
dataincellxdataincellxdataincellxdataincellxdataincell
Where x is separates the cell data
If there is no data in any cell's then we want to make sure there is'nt tow xx behaind each other
VB Code:
Private Sub Command1_Click()
With FG2
.Col = 18
.Text = Combo6.Text & "x" & Combo7.Text & "x" & Combo9.Text & "x" & Combo10.Text & "x" & _
Combo14.Text & "x" & Combo15.Text & "x" & Combo17.Text & "x" & Combo18.Text & "x" & _
Combo23.Text & "x" & Combo24.Text & "x" & Combo26.Text & "x" & Combo27.Text & "x" & _
Combo31.Text & "x" & Combo32.Text & "x" & Combo34.Text & "x" & Combo35.Text
FG2.Text = Replace(FG2.Text, "xx", "x") ' If there is more then 2 xx it want work
' Also if i enter the data in any combo then i press the command
' then i clear the data and press the command it want work
End With
End Sub
What i miss
Re: FlexGrid Format Cell's
A quick loop will work
VB Code:
Do
If InStr(1, strTemp, "xx") = 0 Then Exit Do
strTemp = Replace(strTemp, "xx", "x")
Loop
Re: FlexGrid Format Cell's
instead you can change your code with the IIf statement like
VB Code:
.Col = 18
.Text =
IIf(Trim(Combo6.Text) = "", "", Combo6.Text & "x") & _
IIf(Trim(Combo7.Text) = "", "", Combo7.Text & "x") & _
IIf(Trim(Combo9.Text) = "", "", Combo9.Text & "x")
'...and so on
Re: FlexGrid Format Cell's
Thank's brucevde
ganeshmoorthy
Both working
Except that if i choose only 1 combo and click the command the format will be like that
Dataincellx
The x is only separates the data
The x not start befor the data and it will not be after the data
I will try work on it
Thank's
Re: FlexGrid Format Cell's
Quote:
Originally Posted by ganeshmoorthy
instead you can change your code with the IIf statement like
VB Code:
.Col = 18
.Text =
IIf(Trim(Combo6.Text) = "", "", Combo6.Text & "x") & _
IIf(Trim(Combo7.Text) = "", "", Combo7.Text & "x") & _
IIf(Trim(Combo9.Text) = "", "", Combo9.Text & "x")
'...and so on
I thought it was solved but i figure that the result for combo.text it will be all the same for all row's in .Col 18
I want each row got his own format shown in .Col 18