LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 31
Default Another Check-box problem

Hopefully someone will be able to provide me with an answer for this
one. I am having a lot of difficulty getting VBA to place check boxes
inside the linked cells. I believe the problem with the process is a
result of the varying size of the rows. Is there a way to place these
check box objects inside the appropriate cell without modifying the
spreadsheet layout?

I have created a spreadsheet which pulls most of its information from 3
different access databases. This data is presented in a spreadsheet at
the user's request. Now the end-user wants to add the check box in the
1st column (Lucky me) as an indicator for quality control. I am trying
to modify the spreadsheet as little as possible and as a result I am
trying to add these checkboxes at the end of processing the data when
the spreadsheet is formatted with "size-to-fit" cells. Below is the
process I am using to create the check boxes. It is a modification of
code I found earlier on this website and I am sorry but I didn't
bookmark the programmer to provide recognition in this post. Thank you
very much for any help you can provide.

Dim myCBX As CheckBox
Dim myCell As Range
Dim cntr As Integer

cntr = rowcount + 1
Columns("A:A").Select
With Selection
.Insert Shift:=xlToRight
.ColumnWidth = 6
End With

Columns("B:D").Select 'Formatting of header cells
With Selection 'cause me to delete these now
.Delete Shift:=xlToLeft
End With

With ActiveSheet
For Each myCell In Range("A6:A" & cntr & "")
Set ChkBox = ActiveSheet.CheckBoxes.Add _
(myCell.Left, myCell.Top, _
myCell.Width, myCell.Height)
ChkBox.LinkedCell = myCell.Address
ChkBox.Caption = ""
Next myCell
End With

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Check box problem Mourad Makar Excel Discussion (Misc queries) 0 July 30th 07 07:28 PM
Check box problem bhrosey via OfficeKB.com Excel Discussion (Misc queries) 2 June 20th 07 09:10 PM
Problem with validation check! Neo1 Excel Worksheet Functions 4 March 19th 06 03:28 AM
Check Box weird problem Dave Peterson[_3_] Excel Programming 2 July 27th 04 12:29 AM
Check Box weird problem Tom Ogilvy Excel Programming 3 July 23rd 04 03:22 AM


All times are GMT +1. The time now is 02:11 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"