Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 90
Default Not resetting all cells

The following code works for the first ActiveSheet.ScrollBar1.Value command
works, but the ActiveSheet.ScrollBar2-9 commands do not. The last 4 commands
(ActiveSheet.Range("D10) through "D16" also work. Appreciate any help.
Thanks.

ActiveSheet.ScrollBar1.Value = ActiveSheet.Range("U31")
ActiveSheet.ScrollBar2.Value = ActiveSheet.Range("U32")
ActiveSheet.ScrollBar3.Value = ActiveSheet.Range("U33")
ActiveSheet.ScrollBar4.Value = ActiveSheet.Range("U34")
ActiveSheet.ScrollBar5.Value = ActiveSheet.Range("U35")
ActiveSheet.ScrollBar6.Value = ActiveSheet.Range("U36")
ActiveSheet.ScrollBar7.Value = ActiveSheet.Range("U37")
ActiveSheet.ScrollBar8.Value = ActiveSheet.Range("U38")
ActiveSheet.ScrollBar9.Value = ActiveSheet.Range("U39")

ActiveSheet.Range("D10") = Range("C10")
ActiveSheet.Range("D12") = Range("C12")
ActiveSheet.Range("D14") = Range("C14")
ActiveSheet.Range("D16") = Range("C16")
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default Not resetting all cells

Be sure your cells are formatted as numbers and not text. Your code looks OK.

"Chuck" wrote:

The following code works for the first ActiveSheet.ScrollBar1.Value command
works, but the ActiveSheet.ScrollBar2-9 commands do not. The last 4 commands
(ActiveSheet.Range("D10) through "D16" also work. Appreciate any help.
Thanks.

ActiveSheet.ScrollBar1.Value = ActiveSheet.Range("U31")
ActiveSheet.ScrollBar2.Value = ActiveSheet.Range("U32")
ActiveSheet.ScrollBar3.Value = ActiveSheet.Range("U33")
ActiveSheet.ScrollBar4.Value = ActiveSheet.Range("U34")
ActiveSheet.ScrollBar5.Value = ActiveSheet.Range("U35")
ActiveSheet.ScrollBar6.Value = ActiveSheet.Range("U36")
ActiveSheet.ScrollBar7.Value = ActiveSheet.Range("U37")
ActiveSheet.ScrollBar8.Value = ActiveSheet.Range("U38")
ActiveSheet.ScrollBar9.Value = ActiveSheet.Range("U39")

ActiveSheet.Range("D10") = Range("C10")
ActiveSheet.Range("D12") = Range("C12")
ActiveSheet.Range("D14") = Range("C14")
ActiveSheet.Range("D16") = Range("C16")

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 90
Default Not resetting all cells

Thanks for responding. However, the scrollbars and the linked cells are all
formatted the same (as numbers).

"JLGWhiz" wrote:

Be sure your cells are formatted as numbers and not text. Your code looks OK.

"Chuck" wrote:

The following code works for the first ActiveSheet.ScrollBar1.Value command
works, but the ActiveSheet.ScrollBar2-9 commands do not. The last 4 commands
(ActiveSheet.Range("D10) through "D16" also work. Appreciate any help.
Thanks.

ActiveSheet.ScrollBar1.Value = ActiveSheet.Range("U31")
ActiveSheet.ScrollBar2.Value = ActiveSheet.Range("U32")
ActiveSheet.ScrollBar3.Value = ActiveSheet.Range("U33")
ActiveSheet.ScrollBar4.Value = ActiveSheet.Range("U34")
ActiveSheet.ScrollBar5.Value = ActiveSheet.Range("U35")
ActiveSheet.ScrollBar6.Value = ActiveSheet.Range("U36")
ActiveSheet.ScrollBar7.Value = ActiveSheet.Range("U37")
ActiveSheet.ScrollBar8.Value = ActiveSheet.Range("U38")
ActiveSheet.ScrollBar9.Value = ActiveSheet.Range("U39")

ActiveSheet.Range("D10") = Range("C10")
ActiveSheet.Range("D12") = Range("C12")
ActiveSheet.Range("D14") = Range("C14")
ActiveSheet.Range("D16") = Range("C16")

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22,906
Default Not resetting all cells

Formatting means nothing.

If the cells' values are actually text, re-formatting to General or Number will
not change that fact.

You must coerce them from text to numeric.


Gord Dibben MS Excel MVP

On Mon, 17 Dec 2007 12:14:23 -0800, Chuck
wrote:

Thanks for responding. However, the scrollbars and the linked cells are all
formatted the same (as numbers).

"JLGWhiz" wrote:

Be sure your cells are formatted as numbers and not text. Your code looks OK.

"Chuck" wrote:

The following code works for the first ActiveSheet.ScrollBar1.Value command
works, but the ActiveSheet.ScrollBar2-9 commands do not. The last 4 commands
(ActiveSheet.Range("D10) through "D16" also work. Appreciate any help.
Thanks.

ActiveSheet.ScrollBar1.Value = ActiveSheet.Range("U31")
ActiveSheet.ScrollBar2.Value = ActiveSheet.Range("U32")
ActiveSheet.ScrollBar3.Value = ActiveSheet.Range("U33")
ActiveSheet.ScrollBar4.Value = ActiveSheet.Range("U34")
ActiveSheet.ScrollBar5.Value = ActiveSheet.Range("U35")
ActiveSheet.ScrollBar6.Value = ActiveSheet.Range("U36")
ActiveSheet.ScrollBar7.Value = ActiveSheet.Range("U37")
ActiveSheet.ScrollBar8.Value = ActiveSheet.Range("U38")
ActiveSheet.ScrollBar9.Value = ActiveSheet.Range("U39")

ActiveSheet.Range("D10") = Range("C10")
ActiveSheet.Range("D12") = Range("C12")
ActiveSheet.Range("D14") = Range("C14")
ActiveSheet.Range("D16") = Range("C16")


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default Not resetting all cells

What are you expecting to happen with the command? That is, do you expect
the scrollbox for those eight scrollbars to be in a position between the max
and min that would result in a scroll by equating to the values in cells
U32-U39? When you say it is not working, it helps to define what you are
expecting it to do.

"Chuck" wrote:

Thanks for responding. However, the scrollbars and the linked cells are all
formatted the same (as numbers).

"JLGWhiz" wrote:

Be sure your cells are formatted as numbers and not text. Your code looks OK.

"Chuck" wrote:

The following code works for the first ActiveSheet.ScrollBar1.Value command
works, but the ActiveSheet.ScrollBar2-9 commands do not. The last 4 commands
(ActiveSheet.Range("D10) through "D16" also work. Appreciate any help.
Thanks.

ActiveSheet.ScrollBar1.Value = ActiveSheet.Range("U31")
ActiveSheet.ScrollBar2.Value = ActiveSheet.Range("U32")
ActiveSheet.ScrollBar3.Value = ActiveSheet.Range("U33")
ActiveSheet.ScrollBar4.Value = ActiveSheet.Range("U34")
ActiveSheet.ScrollBar5.Value = ActiveSheet.Range("U35")
ActiveSheet.ScrollBar6.Value = ActiveSheet.Range("U36")
ActiveSheet.ScrollBar7.Value = ActiveSheet.Range("U37")
ActiveSheet.ScrollBar8.Value = ActiveSheet.Range("U38")
ActiveSheet.ScrollBar9.Value = ActiveSheet.Range("U39")

ActiveSheet.Range("D10") = Range("C10")
ActiveSheet.Range("D12") = Range("C12")
ActiveSheet.Range("D14") = Range("C14")
ActiveSheet.Range("D16") = Range("C16")



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 90
Default Not resetting all cells

What I would like to happen is that when the Command Button is clicked, the
scrollbar returns to the value in cell U31, for example. Let's say that cell
U31 has a value of 5,000 and the current value of the scrollbar is 4,500.
When the Command Button is clicked the scrollbar should move to 5,000. This
only happens with the first line of code (referring to cell U31), but not the
lines of code referring to U32-U39.

"JLGWhiz" wrote:

What are you expecting to happen with the command? That is, do you expect
the scrollbox for those eight scrollbars to be in a position between the max
and min that would result in a scroll by equating to the values in cells
U32-U39? When you say it is not working, it helps to define what you are
expecting it to do.

"Chuck" wrote:

Thanks for responding. However, the scrollbars and the linked cells are all
formatted the same (as numbers).

"JLGWhiz" wrote:

Be sure your cells are formatted as numbers and not text. Your code looks OK.

"Chuck" wrote:

The following code works for the first ActiveSheet.ScrollBar1.Value command
works, but the ActiveSheet.ScrollBar2-9 commands do not. The last 4 commands
(ActiveSheet.Range("D10) through "D16" also work. Appreciate any help.
Thanks.

ActiveSheet.ScrollBar1.Value = ActiveSheet.Range("U31")
ActiveSheet.ScrollBar2.Value = ActiveSheet.Range("U32")
ActiveSheet.ScrollBar3.Value = ActiveSheet.Range("U33")
ActiveSheet.ScrollBar4.Value = ActiveSheet.Range("U34")
ActiveSheet.ScrollBar5.Value = ActiveSheet.Range("U35")
ActiveSheet.ScrollBar6.Value = ActiveSheet.Range("U36")
ActiveSheet.ScrollBar7.Value = ActiveSheet.Range("U37")
ActiveSheet.ScrollBar8.Value = ActiveSheet.Range("U38")
ActiveSheet.ScrollBar9.Value = ActiveSheet.Range("U39")

ActiveSheet.Range("D10") = Range("C10")
ActiveSheet.Range("D12") = Range("C12")
ActiveSheet.Range("D14") = Range("C14")
ActiveSheet.Range("D16") = Range("C16")

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default Not resetting all cells

Then like Gord wrote, you need to make sure that the value you see in your
reference cells is, in fact, numerical. You can run an easy check with a
message box: MsgBox ActiveSheet.Range("U32")

If you see "5000" in the message box, you identify the problem as text.
If you see 5000 in the message box, and it still does not set to the correct
position, then you have another type problem elsewhere.

You can concatenate the ranges and check them all at once.

Good Luck
"Chuck" wrote:

What I would like to happen is that when the Command Button is clicked, the
scrollbar returns to the value in cell U31, for example. Let's say that cell
U31 has a value of 5,000 and the current value of the scrollbar is 4,500.
When the Command Button is clicked the scrollbar should move to 5,000. This
only happens with the first line of code (referring to cell U31), but not the
lines of code referring to U32-U39.

"JLGWhiz" wrote:

What are you expecting to happen with the command? That is, do you expect
the scrollbox for those eight scrollbars to be in a position between the max
and min that would result in a scroll by equating to the values in cells
U32-U39? When you say it is not working, it helps to define what you are
expecting it to do.

"Chuck" wrote:

Thanks for responding. However, the scrollbars and the linked cells are all
formatted the same (as numbers).

"JLGWhiz" wrote:

Be sure your cells are formatted as numbers and not text. Your code looks OK.

"Chuck" wrote:

The following code works for the first ActiveSheet.ScrollBar1.Value command
works, but the ActiveSheet.ScrollBar2-9 commands do not. The last 4 commands
(ActiveSheet.Range("D10) through "D16" also work. Appreciate any help.
Thanks.

ActiveSheet.ScrollBar1.Value = ActiveSheet.Range("U31")
ActiveSheet.ScrollBar2.Value = ActiveSheet.Range("U32")
ActiveSheet.ScrollBar3.Value = ActiveSheet.Range("U33")
ActiveSheet.ScrollBar4.Value = ActiveSheet.Range("U34")
ActiveSheet.ScrollBar5.Value = ActiveSheet.Range("U35")
ActiveSheet.ScrollBar6.Value = ActiveSheet.Range("U36")
ActiveSheet.ScrollBar7.Value = ActiveSheet.Range("U37")
ActiveSheet.ScrollBar8.Value = ActiveSheet.Range("U38")
ActiveSheet.ScrollBar9.Value = ActiveSheet.Range("U39")

ActiveSheet.Range("D10") = Range("C10")
ActiveSheet.Range("D12") = Range("C12")
ActiveSheet.Range("D14") = Range("C14")
ActiveSheet.Range("D16") = Range("C16")

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
Resetting cells to zero value. Ron New Users to Excel 5 April 26th 23 11:48 AM
Resetting multiple cells containing drop-down lists christophercbrewster via OfficeKB.com Excel Discussion (Misc queries) 3 August 13th 09 02:58 PM
Resetting cells Chuck Excel Worksheet Functions 1 December 17th 07 06:45 PM
resetting controlsource cells Sherry Marshall Excel Programming 0 April 2nd 04 06:54 PM
Resetting cells Sony[_3_] Excel Programming 5 February 4th 04 03:31 PM


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