vendredi 19 mars 2021

Mark Check box of Form controls if specific text exists in specific entire column

i need to Check box of Form controls to be selected and un selected automatically if specific text exists in specific entire column

i tried below code in the sheet code

 Dim New As Worksheet
 Set New = ThisWorkbook.Worksheets("TestSH")
 Dim Rng As Range
 Set Rng = New.Range("A1:A")

 If Rng.Value = "Text" Then
     New.CheckBoxes("XXX").Value = True
 Else
     New.CheckBoxes("XXX").Value = False
 End If

and how to change the name correctly of the check box i tried to change it from name box located in the formula bar after selecting the check box button




Which CSS property determines the vertical alignment of checkbox's text?

The texts in my form don't vertically centerally aligned to the checkboxes. Do you know which CSS property determines this alignment?




jeudi 18 mars 2021

Checkbox Enabling

For Xamarin Forms:

I am looking to use checkboxes to enable the next set in a series. I have used x:name to set the names of the checkboxes (Fiore, Leichtenauer and Guards). My goal is to set a if statement to change the IsEnabled to false/true in the code behind when the first checkbox is checked. I seem to be getting an error for the IsEnabled, what should I be using instead? Thank you in advance.

private void CheckBox_CheckedChanged(object sender, CheckedChangedEventArgs e)
    {
        if (Fiore.IsChecked)
        {
            Leichtenauer = IsEnabled(false),
            Guards = IsEnabled(true)
        }
    }



mark checkbox after using excel filetoopen function and the file is imported

i made a function to open file and import its data to another worksheet so i need to use check box as a validation so that when the file is uploaded the check box is marked so is there an option to mark check box after the file is imported and data is copied

i thought of a possible solution but i do not know if it is a good one or there is another better solution: i though to create a check box on worksheet named First where i need it to be created and using the imported data of the opened file which are pasted at another worksheet in the same workbook named Second to check if the range A1:A to last row of A contains a specific text for example: A1 and A2 and A3 and A4 contains text XX,YY,ZZ,MM and may XX,YY,ZZ,MM not exists in order in the A1:A range

For more clairfication A1=ZZ A2= XX A3=MM A4=XX A5=yy and so on , so is there an option to search for XX in A2: last row of A and when it is found, the check box on the sheet named first is checked.

Dim FileToOpen5 As Variant
Dim OpenBook5 As Workbook

    FileToOpen5 = Application.GetOpenFilename(Title:="Browse for your File & Import Range", FileFilter:="Excel Files (*.xls*),*xls*")
    If FileToOpen5 <> False Then
        Set OpenBook5 = Application.Workbooks.Open(FileToOpen5)
        Set Ssheet5 = OpenBook5.Worksheets("Default")
                    
         SaveChanges = False
         OpenBook5.Close
  End If

'Selecting Destination and last row to copy the data after it

Set DestShtBPSV = ThisWorkbook.Worksheets("Second")
Dim LR_DestShtBV As Long

LR_DestShtBV = DestShtBPSV.Cells(DestShtBPSV.Rows.Count, "B").End(xlUp).Offset(1).Row

                                                                                   
'Select LastRow of the imported file
Dim LastRowAV As Long
LastRowAV = Ssheet5.Cells(Ssheet5.Rows.Count, "A").End(xlUp).Offset(1).Row
Ssheet5.Range("A2:A" & LastRowAV).Copy Destination:=DestShtBPSV.Cells(LR_DestShtBV, "D")

      OpenBook5.Save
      OpenBook5.Close True



How can I use Google Sheets Apps Script to clear cells if I uncheck a tick box?

Not a programmer so I'm begging for a little help. I have a very simple spreadsheet with certain columns that have tick boxes and adjacent empty columns. My code at this point allows that if the box is checked, the current date and time will be populated in the next cell in the adjacent column. (The code works on all the sheets in the workbook.) I need to know what to add or tweak so that if the box is UNchecked, the neighboring cell will switch back to empty. Thanks in advance!

function onEdit() {
var s = SpreadsheetApp.getActiveSheet();
var r = s.getActiveCell();
if( r.getColumn() == 2 ) { 
var nextCell = r.offset(0, 1);
if( nextCell.getValue() === '' ) 
nextCell.setValue(new Date()).setNumberFormat("MM-dd-yyyy hh:mm");
}

if( r.getColumn() == 4 ) { 
var nextCell = r.offset(0, 1);
if( nextCell.getValue() === '' ) 
nextCell.setValue(new Date()).setNumberFormat("MM-dd-yyyy hh:mm");
}

if( r.getColumn() == 8 ) { 
var nextCell = r.offset(0, 1);
if( nextCell.getValue() === '' ) 
nextCell.setValue(new Date()).setNumberFormat("MM-dd-yyyy hh:mm");
}

if( r.getColumn() == 10 ) { 
var nextCell = r.offset(0, 1);
if( nextCell.getValue() === '' ) 
nextCell.setValue(new Date()).setNumberFormat("MM-dd-yyyy hh:mm");
}

if( r.getColumn() == 14 ) { 
var nextCell = r.offset(0, 1);
if( nextCell.getValue() === '' ) 
nextCell.setValue(new Date()).setNumberFormat("MM-dd-yyyy hh:mm");
}

if( r.getColumn() == 16 ) { 
var nextCell = r.offset(0, 1);
if( nextCell.getValue() === '' ) 
nextCell.setValue(new Date()).setNumberFormat("MM-dd-yyyy hh:mm");
}
}



How can i use panel just like a checkbox? [closed]

I want to use a Panel just like a Checkbox. i hope you guys can help :)

        {
            if ()
            {
                panel11.BackColor = Color.Lime;
                mem.WriteMemory(" ", "bytes", " ");
            }
            else
            {
                panel11.BackColor = Color.Black;
                mem.WriteMemory(" ", "bytes", " ");
            }
        }



Vba to mark Check Box if specific cells contains specific imput

i need to create check box to be checked only if another specific cell contains specific input and unchecked if this input is not existing, noting that i tried below code

Private Sub Worksheet_Ca()

Dim DestS As Worksheet
Set DestS = ThisWorkbook.Worksheets("rest")

Dim DestSh As Range
Set DestSh = DestS.Range("B2")

If DestSh.Value = "Device" Then
DestS.CheckBoxes("Reset").Value = xlOn
Else
DestS.CheckBoxes("Reset").Value = xlOff
End If
End Sub

Also the check box i used is part of the forms toolbar not activeX and i changed the name of the check box to 'reset'

The error i got using debug is method of checkbox of object _worksheet failed