Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 88
Default How do I Freeze information to keep from updating

I created a macro to preform this function below. Once
that function is preformed the user has the option of
keeping all or some of the returned data.

How do I make the macro only look at the valid unkeept
data to change. I put in a "check box form" to let the
user select the data to keep, but how do I tell the macro
to ignor that portion of the spread sheet?

Sub ShipCaptCrew()
Randomize
Dim NextRow As Long
Range("Die1") = Int(Rnd() * 6) + 1
Range("Die2") = Int(Rnd() * 6) + 1
Range("Die3") = Int(Rnd() * 6) + 1
Range("Die4") = Int(Rnd() * 6) + 1
Range("Die5") = Int(Rnd() * 6) + 1

Any help will be great.
Thanks
Pete W.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 599
Default How do I Freeze information to keep from updating

Pete

Do you have checkboxes next to the ranges? Are those checkboxes linked to
cells?

Let's say you have five checkboxes next to Die1 - Die5 and those checkboxes
are linked to the cells just to the right of Die1-Die5. Now your macro
could look like this

Sub ShipCaptCrew()
Dim i as Long
For i = 1 to 5
With Range("Die " & i)
If Not .Offset(0,1).Value Then
Randomize
.Value = Int(Rnd() * 6) + 1
End If
End With
Next i
End Sub

This will look at the cell to the right of Die x (.Offset(1,0)) and if it's
Not TRUE (Check box wasn't checked), then it will replace it's value with a
new random number.

--
Dick Kusleika
MVP - Excel
www.dicks-clicks.com
Post all replies to the newsgroup.

"Pete" wrote in message
...
I created a macro to preform this function below. Once
that function is preformed the user has the option of
keeping all or some of the returned data.

How do I make the macro only look at the valid unkeept
data to change. I put in a "check box form" to let the
user select the data to keep, but how do I tell the macro
to ignor that portion of the spread sheet?

Sub ShipCaptCrew()
Randomize
Dim NextRow As Long
Range("Die1") = Int(Rnd() * 6) + 1
Range("Die2") = Int(Rnd() * 6) + 1
Range("Die3") = Int(Rnd() * 6) + 1
Range("Die4") = Int(Rnd() * 6) + 1
Range("Die5") = Int(Rnd() * 6) + 1

Any help will be great.
Thanks
Pete W.



  #3   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default How do I Freeze information to keep from updating

Dick

Thanks for you insight to this question of mine. However I
did what you said and entered this code you posted, only
to incurr a run time error 1004 ~Method Range of
object_Glodal Failed~ @ With Range("Die " & i). Any
thoughts?

If I take out the space between With Range("Die " & i) to
look like this ("~With Range("Die" & i)~"), then the macro
will work but the checkboxes won't preform the hold
function.

Thanks for your help.
Pete

-----Original Message-----
Pete

Do you have checkboxes next to the ranges? Are those

checkboxes linked to
cells?

Let's say you have five checkboxes next to Die1 - Die5

and those checkboxes
are linked to the cells just to the right of Die1-Die5.

Now your macro
could look like this

Sub ShipCaptCrew()
Dim i as Long
For i = 1 to 5
With Range("Die " & i)
If Not .Offset(0,1).Value Then
Randomize
.Value = Int(Rnd() * 6) + 1
End If
End With
Next i
End Sub

This will look at the cell to the right of Die x (.Offset

(1,0)) and if it's
Not TRUE (Check box wasn't checked), then it will replace

it's value with a
new random number.

--
Dick Kusleika
MVP - Excel
www.dicks-clicks.com
Post all replies to the newsgroup.

"Pete" wrote in

message
...
I created a macro to preform this function below. Once
that function is preformed the user has the option of
keeping all or some of the returned data.

How do I make the macro only look at the valid unkeept
data to change. I put in a "check box form" to let the
user select the data to keep, but how do I tell the

macro
to ignor that portion of the spread sheet?

Sub ShipCaptCrew()
Randomize
Dim NextRow As Long
Range("Die1") = Int(Rnd() * 6) + 1
Range("Die2") = Int(Rnd() * 6) + 1
Range("Die3") = Int(Rnd() * 6) + 1
Range("Die4") = Int(Rnd() * 6) + 1
Range("Die5") = Int(Rnd() * 6) + 1

Any help will be great.
Thanks
Pete W.



.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 599
Default How do I Freeze information to keep from updating

Pete

It worked for me. We must have something set up differently. Here's my set
up:

I have cells A1-A5 named Die1-Die5. I have 5 checkboxes linked to B1, B2,
B3, B4 and B5, respectively. I'm using checkboxes from the Forms toolbar
and to link them, I right-clicked and chose Format Control and put the range
reference in the Cell Link box. If you are using checkboxes from the
Control Toolbox, you would need to click Properties with the control
selected and fill in LinkedCell property.

When I run it, it puts a random number between 1 and 6 in each of A1:A5. If
I check the box that corresponds with a number and re-run the macro, that
number doesn't change.

I can send you the workbook on which I tested this, or if you like, you can
send me your workbook if you can't figure out what the difference is.

--
Dick Kusleika
MVP - Excel
www.dicks-clicks.com
Post all replies to the newsgroup.

wrote in message
...
Dick

Thanks for you insight to this question of mine. However I
did what you said and entered this code you posted, only
to incurr a run time error 1004 ~Method Range of
object_Glodal Failed~ @ With Range("Die " & i). Any
thoughts?

If I take out the space between With Range("Die " & i) to
look like this ("~With Range("Die" & i)~"), then the macro
will work but the checkboxes won't preform the hold
function.

Thanks for your help.
Pete

-----Original Message-----
Pete

Do you have checkboxes next to the ranges? Are those

checkboxes linked to
cells?

Let's say you have five checkboxes next to Die1 - Die5

and those checkboxes
are linked to the cells just to the right of Die1-Die5.

Now your macro
could look like this

Sub ShipCaptCrew()
Dim i as Long
For i = 1 to 5
With Range("Die " & i)
If Not .Offset(0,1).Value Then
Randomize
.Value = Int(Rnd() * 6) + 1
End If
End With
Next i
End Sub

This will look at the cell to the right of Die x (.Offset

(1,0)) and if it's
Not TRUE (Check box wasn't checked), then it will replace

it's value with a
new random number.

--
Dick Kusleika
MVP - Excel
www.dicks-clicks.com
Post all replies to the newsgroup.

"Pete" wrote in

message
...
I created a macro to preform this function below. Once
that function is preformed the user has the option of
keeping all or some of the returned data.

How do I make the macro only look at the valid unkeept
data to change. I put in a "check box form" to let the
user select the data to keep, but how do I tell the

macro
to ignor that portion of the spread sheet?

Sub ShipCaptCrew()
Randomize
Dim NextRow As Long
Range("Die1") = Int(Rnd() * 6) + 1
Range("Die2") = Int(Rnd() * 6) + 1
Range("Die3") = Int(Rnd() * 6) + 1
Range("Die4") = Int(Rnd() * 6) + 1
Range("Die5") = Int(Rnd() * 6) + 1

Any help will be great.
Thanks
Pete W.



.



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 88
Default How do I Freeze information to keep from updating

Dick

I sent you a E-mail directly to your computer @
. If that is not your e-
mail address please e-mail me @
.

Thanks
Pete W

-----Original Message-----
Pete

It worked for me. We must have something set up

differently. Here's my set
up:

I have cells A1-A5 named Die1-Die5. I have 5 checkboxes

linked to B1, B2,
B3, B4 and B5, respectively. I'm using checkboxes from

the Forms toolbar
and to link them, I right-clicked and chose Format

Control and put the range
reference in the Cell Link box. If you are using

checkboxes from the
Control Toolbox, you would need to click Properties with

the control
selected and fill in LinkedCell property.

When I run it, it puts a random number between 1 and 6 in

each of A1:A5. If
I check the box that corresponds with a number and re-run

the macro, that
number doesn't change.

I can send you the workbook on which I tested this, or if

you like, you can
send me your workbook if you can't figure out what the

difference is.

--
Dick Kusleika
MVP - Excel
www.dicks-clicks.com
Post all replies to the newsgroup.

wrote in message
...
Dick

Thanks for you insight to this question of mine.

However I
did what you said and entered this code you posted, only
to incurr a run time error 1004 ~Method Range of
object_Glodal Failed~ @ With Range("Die " & i). Any
thoughts?

If I take out the space between With Range("Die " & i)

to
look like this ("~With Range("Die" & i)~"), then the

macro
will work but the checkboxes won't preform the hold
function.

Thanks for your help.
Pete

-----Original Message-----
Pete

Do you have checkboxes next to the ranges? Are those

checkboxes linked to
cells?

Let's say you have five checkboxes next to Die1 - Die5

and those checkboxes
are linked to the cells just to the right of Die1-Die5.

Now your macro
could look like this

Sub ShipCaptCrew()
Dim i as Long
For i = 1 to 5
With Range("Die " & i)
If Not .Offset(0,1).Value Then
Randomize
.Value = Int(Rnd() * 6) + 1
End If
End With
Next i
End Sub

This will look at the cell to the right of Die x

(.Offset
(1,0)) and if it's
Not TRUE (Check box wasn't checked), then it will

replace
it's value with a
new random number.

--
Dick Kusleika
MVP - Excel
www.dicks-clicks.com
Post all replies to the newsgroup.

"Pete" wrote in

message
...
I created a macro to preform this function below.

Once
that function is preformed the user has the option of
keeping all or some of the returned data.

How do I make the macro only look at the valid

unkeept
data to change. I put in a "check box form" to let

the
user select the data to keep, but how do I tell the

macro
to ignor that portion of the spread sheet?

Sub ShipCaptCrew()
Randomize
Dim NextRow As Long
Range("Die1") = Int(Rnd() * 6) + 1
Range("Die2") = Int(Rnd() * 6) + 1
Range("Die3") = Int(Rnd() * 6) + 1
Range("Die4") = Int(Rnd() * 6) + 1
Range("Die5") = Int(Rnd() * 6) + 1

Any help will be great.
Thanks
Pete W.


.



.



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 88
Default How do I Freeze information to keep from updating

Dick

I sent you a E-mail directly to your computer @
. If that is not your e-
mail address please e-mail me @
.

Thanks
Pete W

-----Original Message-----
Pete

It worked for me. We must have something set up

differently. Here's my set
up:

I have cells A1-A5 named Die1-Die5. I have 5 checkboxes

linked to B1, B2,
B3, B4 and B5, respectively. I'm using checkboxes from

the Forms toolbar
and to link them, I right-clicked and chose Format

Control and put the range
reference in the Cell Link box. If you are using

checkboxes from the
Control Toolbox, you would need to click Properties with

the control
selected and fill in LinkedCell property.

When I run it, it puts a random number between 1 and 6 in

each of A1:A5. If
I check the box that corresponds with a number and re-run

the macro, that
number doesn't change.

I can send you the workbook on which I tested this, or if

you like, you can
send me your workbook if you can't figure out what the

difference is.

--
Dick Kusleika
MVP - Excel
www.dicks-clicks.com
Post all replies to the newsgroup.

wrote in message
...
Dick

Thanks for you insight to this question of mine.

However I
did what you said and entered this code you posted, only
to incurr a run time error 1004 ~Method Range of
object_Glodal Failed~ @ With Range("Die " & i). Any
thoughts?

If I take out the space between With Range("Die " & i)

to
look like this ("~With Range("Die" & i)~"), then the

macro
will work but the checkboxes won't preform the hold
function.

Thanks for your help.
Pete

-----Original Message-----
Pete

Do you have checkboxes next to the ranges? Are those

checkboxes linked to
cells?

Let's say you have five checkboxes next to Die1 - Die5

and those checkboxes
are linked to the cells just to the right of Die1-Die5.

Now your macro
could look like this

Sub ShipCaptCrew()
Dim i as Long
For i = 1 to 5
With Range("Die " & i)
If Not .Offset(0,1).Value Then
Randomize
.Value = Int(Rnd() * 6) + 1
End If
End With
Next i
End Sub

This will look at the cell to the right of Die x

(.Offset
(1,0)) and if it's
Not TRUE (Check box wasn't checked), then it will

replace
it's value with a
new random number.

--
Dick Kusleika
MVP - Excel
www.dicks-clicks.com
Post all replies to the newsgroup.

"Pete" wrote in

message
...
I created a macro to preform this function below.

Once
that function is preformed the user has the option of
keeping all or some of the returned data.

How do I make the macro only look at the valid

unkeept
data to change. I put in a "check box form" to let

the
user select the data to keep, but how do I tell the

macro
to ignor that portion of the spread sheet?

Sub ShipCaptCrew()
Randomize
Dim NextRow As Long
Range("Die1") = Int(Rnd() * 6) + 1
Range("Die2") = Int(Rnd() * 6) + 1
Range("Die3") = Int(Rnd() * 6) + 1
Range("Die4") = Int(Rnd() * 6) + 1
Range("Die5") = Int(Rnd() * 6) + 1

Any help will be great.
Thanks
Pete W.


.



.

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 599
Default How do I Freeze information to keep from updating

Pete

I got it and here was my reply (also emailed):

--------------------------------------------
If I remove the space in Range("Die " & i) to

Range("Die" & i)

then it works fine for me.

The run time error was because there was no Range by that name and removing
the space fixes it.

In your post you said that you removed the space which got rid of the error,
but that the checkboxes didn't hold the values. When I check the box, the
values hold for me. Are you still experiencing that problem? If so, what
are you experiencing? Are the dice changing even when the checkbox is
checked?

--------------------------------------------

BTW, that's a nice looking spreadsheet.

--
Dick Kusleika
MVP - Excel
www.dicks-clicks.com
Post all replies to the newsgroup.

"Pete" wrote in message
...
Dick

I sent you a E-mail directly to your computer @
. If that is not your e-
mail address please e-mail me @
.

Thanks
Pete W

-----Original Message-----
Pete

It worked for me. We must have something set up

differently. Here's my set
up:

I have cells A1-A5 named Die1-Die5. I have 5 checkboxes

linked to B1, B2,
B3, B4 and B5, respectively. I'm using checkboxes from

the Forms toolbar
and to link them, I right-clicked and chose Format

Control and put the range
reference in the Cell Link box. If you are using

checkboxes from the
Control Toolbox, you would need to click Properties with

the control
selected and fill in LinkedCell property.

When I run it, it puts a random number between 1 and 6 in

each of A1:A5. If
I check the box that corresponds with a number and re-run

the macro, that
number doesn't change.

I can send you the workbook on which I tested this, or if

you like, you can
send me your workbook if you can't figure out what the

difference is.

--
Dick Kusleika
MVP - Excel
www.dicks-clicks.com
Post all replies to the newsgroup.

wrote in message
...
Dick

Thanks for you insight to this question of mine.

However I
did what you said and entered this code you posted, only
to incurr a run time error 1004 ~Method Range of
object_Glodal Failed~ @ With Range("Die " & i). Any
thoughts?

If I take out the space between With Range("Die " & i)

to
look like this ("~With Range("Die" & i)~"), then the

macro
will work but the checkboxes won't preform the hold
function.

Thanks for your help.
Pete

-----Original Message-----
Pete

Do you have checkboxes next to the ranges? Are those
checkboxes linked to
cells?

Let's say you have five checkboxes next to Die1 - Die5
and those checkboxes
are linked to the cells just to the right of Die1-Die5.
Now your macro
could look like this

Sub ShipCaptCrew()
Dim i as Long
For i = 1 to 5
With Range("Die " & i)
If Not .Offset(0,1).Value Then
Randomize
.Value = Int(Rnd() * 6) + 1
End If
End With
Next i
End Sub

This will look at the cell to the right of Die x

(.Offset
(1,0)) and if it's
Not TRUE (Check box wasn't checked), then it will

replace
it's value with a
new random number.

--
Dick Kusleika
MVP - Excel
www.dicks-clicks.com
Post all replies to the newsgroup.

"Pete" wrote in
message
...
I created a macro to preform this function below.

Once
that function is preformed the user has the option of
keeping all or some of the returned data.

How do I make the macro only look at the valid

unkeept
data to change. I put in a "check box form" to let

the
user select the data to keep, but how do I tell the
macro
to ignor that portion of the spread sheet?

Sub ShipCaptCrew()
Randomize
Dim NextRow As Long
Range("Die1") = Int(Rnd() * 6) + 1
Range("Die2") = Int(Rnd() * 6) + 1
Range("Die3") = Int(Rnd() * 6) + 1
Range("Die4") = Int(Rnd() * 6) + 1
Range("Die5") = Int(Rnd() * 6) + 1

Any help will be great.
Thanks
Pete W.


.



.



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
Updating information in 1 file when it is added to other files Kyle Excel Discussion (Misc queries) 1 December 18th 09 03:18 PM
Updating Information in all worksheet. SF Excel Discussion (Misc queries) 6 June 2nd 09 06:39 PM
Excel Updating of information [email protected] Excel Worksheet Functions 0 March 5th 08 09:25 AM
Freeze Cell Once Information is Entered SuzieT Excel Discussion (Misc queries) 4 November 8th 07 05:36 PM
Excel Updating Information Revised JohnM New Users to Excel 2 August 3rd 07 04:42 PM


All times are GMT +1. The time now is 03:56 AM.

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"