Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 161
Default check box linked cell

I am trying to link a checkbox to a cell on a different sheet than the
checkbox is in. This is the code I am using:

chk.LinkedCell = Sheets("Estimates
DB").Range("estdbcboxlnkcell").Offset(estnum, 0).Address

When I run it, the checkbox is being linked to a cell on the sheet that the
checkbox is in.

What am I doing wrong?
Thanks
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default check box linked cell

The address looks like E99 (no sheet is included).

Try:
chk.LinkedCell = Sheets("Estimates DB").Range("estdbcboxlnkcell") _
.Offset(estnum, 0).Address(external:=true)



ranswert wrote:

I am trying to link a checkbox to a cell on a different sheet than the
checkbox is in. This is the code I am using:

chk.LinkedCell = Sheets("Estimates
DB").Range("estdbcboxlnkcell").Offset(estnum, 0).Address

When I run it, the checkbox is being linked to a cell on the sheet that the
checkbox is in.

What am I doing wrong?
Thanks


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default check box linked cell

I'm not really sure about this, because I haven't tried it, but I think this
might work:
lnkRng =Sheets("Estimates DB").Range("estdbcboxlnkcell") _
..Offset(estnum, 0).Address
chk.LinkedCell = "'Extimates DB'!lnkRng"

Not sure if the quote marks are right, but you can play with it to get it
right.

"ranswert" wrote:

I am trying to link a checkbox to a cell on a different sheet than the
checkbox is in. This is the code I am using:

chk.LinkedCell = Sheets("Estimates
DB").Range("estdbcboxlnkcell").Offset(estnum, 0).Address

When I run it, the checkbox is being linked to a cell on the sheet that the
checkbox is in.

What am I doing wrong?
Thanks

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 161
Default check box linked cell

I was able to get that to work, I have another problem when I do a sort on
the columns in the range. I removed the '$' from the celllink, but when I
sort, but when they are sorted the linked cell doesn't go with the row it is
tied to.

This is the code that I used:

z = Sheets("Estimates DB").Range("estdbcboxlnkcell").Offset(estnum, 0).Address
z = Replace(z, "$", "")
z = "'Estimates DB'!" & z
chk.LinkedCell = z

How do I get the linked cell to move wtih the row when it is sorted?
Thanks

"JLGWhiz" wrote:

I'm not really sure about this, because I haven't tried it, but I think this
might work:
lnkRng =Sheets("Estimates DB").Range("estdbcboxlnkcell") _
.Offset(estnum, 0).Address
chk.LinkedCell = "'Extimates DB'!lnkRng"

Not sure if the quote marks are right, but you can play with it to get it
right.

"ranswert" wrote:

I am trying to link a checkbox to a cell on a different sheet than the
checkbox is in. This is the code I am using:

chk.LinkedCell = Sheets("Estimates
DB").Range("estdbcboxlnkcell").Offset(estnum, 0).Address

When I run it, the checkbox is being linked to a cell on the sheet that the
checkbox is in.

What am I doing wrong?
Thanks

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default check box linked cell

Range("estdbcboxlnkcell").Offset(estnum, 0).Address

Since you are using a relative reference, as above, the linked cell is
always going to be the same relative location from Range("estdbcboxlnkcell").
If that cell moves with the sort, then the linked cell would move with the
sort. Unfortunately the named cell remains in the same absolute location
with only formulas and values being affected by the sort.

Maybe you should think about doing your sort before you link the cell.

"ranswert" wrote:

I was able to get that to work, I have another problem when I do a sort on
the columns in the range. I removed the '$' from the celllink, but when I
sort, but when they are sorted the linked cell doesn't go with the row it is
tied to.

This is the code that I used:

z = Sheets("Estimates DB").Range("estdbcboxlnkcell").Offset(estnum, 0).Address
z = Replace(z, "$", "")
z = "'Estimates DB'!" & z
chk.LinkedCell = z

How do I get the linked cell to move wtih the row when it is sorted?
Thanks

"JLGWhiz" wrote:

I'm not really sure about this, because I haven't tried it, but I think this
might work:
lnkRng =Sheets("Estimates DB").Range("estdbcboxlnkcell") _
.Offset(estnum, 0).Address
chk.LinkedCell = "'Extimates DB'!lnkRng"

Not sure if the quote marks are right, but you can play with it to get it
right.

"ranswert" wrote:

I am trying to link a checkbox to a cell on a different sheet than the
checkbox is in. This is the code I am using:

chk.LinkedCell = Sheets("Estimates
DB").Range("estdbcboxlnkcell").Offset(estnum, 0).Address

When I run it, the checkbox is being linked to a cell on the sheet that the
checkbox is in.

What am I doing wrong?
Thanks



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 161
Default check box linked cell

Thanks I will give that a try.

"JLGWhiz" wrote:

Range("estdbcboxlnkcell").Offset(estnum, 0).Address

Since you are using a relative reference, as above, the linked cell is
always going to be the same relative location from Range("estdbcboxlnkcell").
If that cell moves with the sort, then the linked cell would move with the
sort. Unfortunately the named cell remains in the same absolute location
with only formulas and values being affected by the sort.

Maybe you should think about doing your sort before you link the cell.

"ranswert" wrote:

I was able to get that to work, I have another problem when I do a sort on
the columns in the range. I removed the '$' from the celllink, but when I
sort, but when they are sorted the linked cell doesn't go with the row it is
tied to.

This is the code that I used:

z = Sheets("Estimates DB").Range("estdbcboxlnkcell").Offset(estnum, 0).Address
z = Replace(z, "$", "")
z = "'Estimates DB'!" & z
chk.LinkedCell = z

How do I get the linked cell to move wtih the row when it is sorted?
Thanks

"JLGWhiz" wrote:

I'm not really sure about this, because I haven't tried it, but I think this
might work:
lnkRng =Sheets("Estimates DB").Range("estdbcboxlnkcell") _
.Offset(estnum, 0).Address
chk.LinkedCell = "'Extimates DB'!lnkRng"

Not sure if the quote marks are right, but you can play with it to get it
right.

"ranswert" wrote:

I am trying to link a checkbox to a cell on a different sheet than the
checkbox is in. This is the code I am using:

chk.LinkedCell = Sheets("Estimates
DB").Range("estdbcboxlnkcell").Offset(estnum, 0).Address

When I run it, the checkbox is being linked to a cell on the sheet that the
checkbox is in.

What am I doing wrong?
Thanks

Reply
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
How do I have a linked cell auto-size to fit the linked data? CristinPDX Excel Discussion (Misc queries) 0 June 24th 08 08:42 PM
Can the check register be linked to account online? natfish Excel Discussion (Misc queries) 0 October 14th 06 08:57 PM
Linked Check Boxes blueegypt Excel Discussion (Misc queries) 4 May 12th 06 10:36 PM
How to know the linked cell of a check box gm139[_2_] Excel Programming 3 February 5th 06 03:33 PM
Check boxes linked to other cells? C. Cunningham Excel Worksheet Functions 4 December 29th 05 11:33 PM


All times are GMT +1. The time now is 07:01 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"