#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 155
Default Spin Box

Hi All,

I have a spin box linked to a cell.
I need to be able to run code that will attach the spin box to a different
cell 13 rows down. The current location of the cell can vary depending on how
many rows are insterted above it, so I cannot simply redefine the spin button
with a fixed cell reference. The new cell can not have a range name.

Thanks,

Squeaky
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,836
Default Spin Box

Can you work with one of these concepts?

Find Last Used Cell:
Sub FindLastCell1()
Cells(Rows.Count, "A").End(xlUp).Select
End Sub

Sub FindLastCell2()
Range("A:A").Find("*", Cells(1), _
xlValues, xlWhole, xlByRows, xlPrevious).Select
End Sub

Find the end of a list? Here are a couple different ways:
this will select the cell. it's not a good practice to select, but just used
as
an illustration here.
range(worksheets("Sheet1").cells(rows.Count,"A").e nd(xlup).address).Select

or if you just want A5 returned:
lastcell = worksheets("Sheet1").cells(rows.Count,"A").end(xlu p).address(0,0)

HTH,
Ryan---

--
Ryan---
If this information was helpful, please indicate this by clicking ''Yes''.


"Squeaky" wrote:

Hi All,

I have a spin box linked to a cell.
I need to be able to run code that will attach the spin box to a different
cell 13 rows down. The current location of the cell can vary depending on how
many rows are insterted above it, so I cannot simply redefine the spin button
with a fixed cell reference. The new cell can not have a range name.

Thanks,

Squeaky

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 155
Default Spin Box

Hi Ryan,

How do I get this to attach itself to the spin button's linked cell reference?

Squeaky

"ryguy7272" wrote:

Can you work with one of these concepts?

Find Last Used Cell:
Sub FindLastCell1()
Cells(Rows.Count, "A").End(xlUp).Select
End Sub

Sub FindLastCell2()
Range("A:A").Find("*", Cells(1), _
xlValues, xlWhole, xlByRows, xlPrevious).Select
End Sub

Find the end of a list? Here are a couple different ways:
this will select the cell. it's not a good practice to select, but just used
as
an illustration here.
range(worksheets("Sheet1").cells(rows.Count,"A").e nd(xlup).address).Select

or if you just want A5 returned:
lastcell = worksheets("Sheet1").cells(rows.Count,"A").end(xlu p).address(0,0)

HTH,
Ryan---

--
Ryan---
If this information was helpful, please indicate this by clicking ''Yes''.


"Squeaky" wrote:

Hi All,

I have a spin box linked to a cell.
I need to be able to run code that will attach the spin box to a different
cell 13 rows down. The current location of the cell can vary depending on how
many rows are insterted above it, so I cannot simply redefine the spin button
with a fixed cell reference. The new cell can not have a range name.

Thanks,

Squeaky

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
Spin box increase value only Mark N Excel Discussion (Misc queries) 1 August 27th 09 03:51 PM
spin up / spin down JT Excel Programming 2 August 10th 07 04:44 PM
spin button bruce forster Excel Programming 1 May 7th 04 12:21 AM
New spin on old problems Arlen[_2_] Excel Programming 9 January 16th 04 06:46 PM
Spin Button Andrew[_14_] Excel Programming 1 July 18th 03 01:51 AM


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

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

About Us

"It's about Microsoft Excel"