I need to clear all from second column (named 1) to the last colomun (named 31), to the and of row, in my case have 52 rows.
note;
The numer of row is dinamic, the coloumn numer are static.
CLEAR all from msflexgrid
-
- PlatinumLounger
- Posts: 4353
- Joined: 26 Apr 2010, 17:36
CLEAR all from msflexgrid
You do not have the required permissions to view the files attached to this post.
Last edited by sal21 on 28 Jun 2021, 16:31, edited 1 time in total.
-
- Administrator
- Posts: 78416
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: CLEAR all from msflexgrid
Perhaps something like
I cannot test this myself.
Code: Select all
Dim i As Long
With Me,MSFlexGrid1
For i = 0 To .Rows - 1
.TextMatrix(i, 1) = ""
Next i
End With
Best wishes,
Hans
Hans
-
- PlatinumLounger
- Posts: 4353
- Joined: 26 Apr 2010, 17:36
Re: CLEAR all from msflexgrid
See image attached...HansV wrote: ↑28 Jun 2021, 15:57Perhaps something like
I cannot test this myself.Code: Select all
Dim i As Long With Me,MSFlexGrid1 For i = 0 To .Rows - 1 .TextMatrix(i, 1) = "" Next i End With
your code clear only the column named "1", and clear also the title column...
I need to clear all column from the named "1" to "GG" to the and rows
Naturally during the clear statement reset the .CellBackColor to the default color (withe in my case)
-
- Administrator
- Posts: 78416
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: CLEAR all from msflexgrid
Code: Select all
Dim i As Long
Dim j As Long
With Me,MSFlexGrid1
For i = 1 To .Rows - 1
For j = 1 To .Columns - 1
.TextMatrix(i, j) = ""
.CellBackColor = vbWhite
Next j
Next i
End With
Best wishes,
Hans
Hans
-
- PlatinumLounger
- Posts: 4353
- Joined: 26 Apr 2010, 17:36
Re: CLEAR all from msflexgrid
work tks.HansV wrote: ↑28 Jun 2021, 17:57Code: Select all
Dim i As Long Dim j As Long With Me,MSFlexGrid1 For i = 1 To .Rows - 1 For j = 1 To .Columns - 1 .TextMatrix(i, j) = "" .CellBackColor = vbWhite Next j Next i End With
But i test the icon in cell...
I fill a cell with:
....
.Col = D
.Row = K
Set .CellPicture = Me.ImageList1.ListImages(1).Picturew
...
and based you code instead to clear a text, now i need to clear the icon from cell, how to?
-
- Administrator
- Posts: 78416
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: CLEAR all from msflexgrid
Inside the loop:
Code: Select all
Set .CellPicture = Nothing
Best wishes,
Hans
Hans
-
- PlatinumLounger
- Posts: 4353
- Joined: 26 Apr 2010, 17:36