Home > Software design >  Macro to link checkboxes cell at Lib Calc
Macro to link checkboxes cell at Lib Calc

Time:01-19

Context: I'm trying to learn excel, for personal and profissional purposes. As I can't afford excel at the moment I'm using Lib Calc which I found very similar. I learnt many things that can be easily used in both programs, but with macros it didn't work so well.

Problem: When I was trying to make a macro that links the checkboxes to a cell of my spreadsheet automatically I couldn't find many useful sites that taught how to make it on Lib Calc, just in excel, so I took a ready-made code to excel and tried to make run on Lib Calc as I read the documentation, but I couldn't make it run. The code that i took was this:

Sub LinkCheckBoxes()
Dim chk As CheckBox
Dim lCol As Long
lCol = 2 'number of columns to the right for link
For Each chk In ActiveSheet.CheckBoxes
   With chk
      .LinkedCell = _
         .TopLeftCell.Offset(0, lCol).Address
   End With
Next chk
End Sub

Source: easy way to make a cell a checkbox

  • Related