Minimum row height, but still accomodating Auto-fit?

stir-crazy

New Member
Joined
Dec 28, 2005
Messages
29
I'm trying to have a check box in each cell of a column that when checked will insert todays date; I found a nice example of how to do that here:

Sub Process_CheckBox()

Dim cBox As CheckBox
Dim LRow As Integer
Dim LRange As String

LName = Application.Caller
Set cBox = ActiveSheet.CheckBoxes(LName)

'Find row that checkbox resides in
LRow = cBox.TopLeftCell.Row
LRange = "B" & CStr(LRow)

'Change date in column B, if checkbox is checked
If cBox.Value > 0 Then
ActiveSheet.Range(LRange).Value = Date

'Clear date in column B, if checkbox is unchecked
Else
ActiveSheet.Range(LRange).Value = Null
End If

End Sub

From: http://techonthenet.com/excel/macros/checkbox.php

However, I'm adding this checkbox to an existing spreadsheet, and the rows vary in height (Autofit). When added to the shorter rows, the checkboxes overlap with the row beneath; moving the checkbox up slightly, however, causes the associated macro to link to the cell above the one I want it to! Arrrrr! :devilish:

I searched, but can't seem to find a way to ensure that the rows are of a certain minimum height, but possibly greater due to Autofit.

Ideas?

Thanks!
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
If you want the row height resized at the time the checkbox is placed in the cell, perhaps you could write a macro which checks row height and sets to a minimum threshold and then places the checkbox.

If you want the row height resized at the time the checkbox is checked, you could add that to the macro you posted.

I've found it very helpful for such tasks to record a macro of me doing the task (resizing the row height) and then edit the macro to see what the code looks like and clean it up and use the bits I need.

Is that at all helpful or have I missed the problem?
 
Upvote 0

Forum statistics

Threads
1,214,650
Messages
6,120,734
Members
448,987
Latest member
marion_davis

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