Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default my macro is clearing the wrong sheet

I wrote a multiple choice tests in excel, it's 7 pages multiple choice with
in cell pull down answer selections. It's also timed which affects your score
if your fast or slow. It also keeps track of the top 10 scores. It has 6
macros that record the time, hide the sheet your one and open the next sheet.
The scores, including times and top 10 are listed on the final sheet which
is just a total sheet. It works perfectly up to that point -- I tried to
record one last macro to reset it ie add new results to top ten list -- print
totals, clear answers, and save it blank on the first page ready for some
one else to take. The final macro I have written about 6 times I hit record
do everything I want it to do, but when i run it, it randomly clears most of
the cells on the total sheet. The total sheet is not selected when I'm
clearing the others. I know it's a lot to ask but I'm going crazy can someone
steer me in the right direction ?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,588
Default my macro is clearing the wrong sheet

post the problem code

Tim

"Polarbear" wrote in message
...
I wrote a multiple choice tests in excel, it's 7 pages multiple
choice with
in cell pull down answer selections. It's also timed which affects
your score
if your fast or slow. It also keeps track of the top 10 scores. It
has 6
macros that record the time, hide the sheet your one and open the
next sheet.
The scores, including times and top 10 are listed on the final sheet
which
is just a total sheet. It works perfectly up to that point -- I
tried to
record one last macro to reset it ie add new results to top ten
list -- print
totals, clear answers, and save it blank on the first page ready
for some
one else to take. The final macro I have written about 6 times I
hit record
do everything I want it to do, but when i run it, it randomly
clears most of
the cells on the total sheet. The total sheet is not selected when
I'm
clearing the others. I know it's a lot to ask but I'm going crazy
can someone
steer me in the right direction ?



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default my macro is clearing the wrong sheet

Not sure how to do that -- I'm not too good at writting macros other than
just recording what I do -- mistakes scrolling and all -- I printed the macro
it took up over two pages but i can try to past it here if it fits ?

Range("I4:J4").Select
Selection.Copy
ActiveWindow.SmallScroll ToRight:=6
ActiveWindow.SmallScroll Down:=9
Range("W24:X24").Select
Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _
xlNone, SkipBlanks:=False, Transpose:=False
Range("U26:Z26").Select
Application.CutCopyMode = False
Selection.Copy
ActiveWindow.SmallScroll ToRight:=-9
ActiveWindow.SmallScroll Down:=22
Range("B35:G35").Select
Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _
xlNone, SkipBlanks:=False, Transpose:=False
Range("B26:G35").Select
Range("F35").Activate
Application.CutCopyMode = False
Selection.Sort Key1:=Range("F26"), Order1:=xlDescending, Key2:=Range( _
"D26"), Order2:=xlDescending, Header:=xlGuess, OrderCustom:=1,
MatchCase _
:=False, Orientation:=xlTopToBottom, DataOption1:=xlSortNormal, _
DataOption2:=xlSortNormal
Range("D31:E31").Select
Sheets("Shift Leader Test").Visible = True
Sheets("Menu Standards").Visible = True

Range("B6,B6:C14,E6:F16,H6:I15,K6:L13,B20:C24,E22: F27,H21:I24,K19:L25").Select
Range("K19").Activate
ActiveWindow.SmallScroll Down:=15
Range( _

"B6,B6:C14,E6:F16,H6:I15,K6:L13,B20:C24,E22:F27,H2 1:I24,K19:L25,B30:C35,E33:F39,H30:I33,K31:L39,H39: I43,B41:C49,E45:F51,H49:I57,K45:L52,B55:C61,E57:F6 2" _
).Select
Range("E57").Activate
Selection.ClearContents
ActiveWindow.SmallScroll Down:=9
Range("E68").Select
Selection.ClearContents
Sheets("Time, temp & thawing").Visible = True
Range("D41").Select
Selection.ClearContents
Range("D3:D38").Select
Range("D38").Activate
Selection.ClearContents
ActiveWindow.SmallScroll Down:=-36
Range("D3").Select
Sheets("Misc policies & procedures ").Visible = True
Range("D22").Select
Selection.ClearContents
Range("D3:D19").Select
Range("D19").Activate
Selection.ClearContents
ActiveWindow.ScrollRow = 12
ActiveWindow.ScrollRow = 11
ActiveWindow.ScrollRow = 10
ActiveWindow.ScrollRow = 9
ActiveWindow.ScrollRow = 8
ActiveWindow.ScrollRow = 7
ActiveWindow.ScrollRow = 6
ActiveWindow.ScrollRow = 5
ActiveWindow.ScrollRow = 4
ActiveWindow.ScrollRow = 3
ActiveWindow.ScrollRow = 2
ActiveWindow.ScrollRow = 1
Range("D3").Select
Sheets("food handling ").Visible = True
Range("D25").Select
Selection.ClearContents
Range("D3:D22").Select
Range("D22").Activate
Selection.ClearContents
ActiveWindow.LargeScroll Down:=-2
Range("D3").Select
Sheets("guest service").Visible = True
Range("D3:D22").Select
Selection.ClearContents
ActiveWindow.LargeScroll Down:=2
Range("D25").Select
Selection.ClearContents
ActiveWindow.LargeScroll Down:=-1
ActiveWindow.ScrollRow = 9
ActiveWindow.ScrollRow = 8
ActiveWindow.ScrollRow = 7
ActiveWindow.ScrollRow = 6
ActiveWindow.ScrollRow = 5
ActiveWindow.ScrollRow = 4
ActiveWindow.ScrollRow = 3
ActiveWindow.ScrollRow = 2
ActiveWindow.ScrollRow = 1
Range("D3").Select
Sheets("Shift Leader Test").Select
Range("B4").Select
Selection.ClearContents
Range("D4").Select
Selection.ClearContents
ActiveWindow.SmallScroll Down:=6
Range("D19:F19").Select
Selection.ClearContents
Sheets("total score ").Select
ActiveWindow.SmallScroll Down:=-15
Sheets(Array("food handling ", "Misc policies & procedures ", _
"Time, temp & thawing", "Menu Standards", "total score ")).Select
Sheets("total score ").Activate
ActiveWindow.ScrollWorkbookTabs Sheets:=-1
ActiveWindow.ScrollWorkbookTabs Sheets:=-1
Sheets(Array("guest service", "food handling ", "Misc policies &
procedures ", _
"Time, temp & thawing", "Menu Standards", "total score ")).Select
Sheets("total score ").Activate
ActiveWindow.SelectedSheets.Visible = False
ActiveWindow.SmallScroll Down:=-21
Range("B4").Select
ActiveWorkbook.Save
End Sub


"Tim Williams" wrote:

post the problem code

Tim

"Polarbear" wrote in message
...
I wrote a multiple choice tests in excel, it's 7 pages multiple
choice with
in cell pull down answer selections. It's also timed which affects
your score
if your fast or slow. It also keeps track of the top 10 scores. It
has 6
macros that record the time, hide the sheet your one and open the
next sheet.
The scores, including times and top 10 are listed on the final sheet
which
is just a total sheet. It works perfectly up to that point -- I
tried to
record one last macro to reset it ie add new results to top ten
list -- print
totals, clear answers, and save it blank on the first page ready
for some
one else to take. The final macro I have written about 6 times I
hit record
do everything I want it to do, but when i run it, it randomly
clears most of
the cells on the total sheet. The total sheet is not selected when
I'm
clearing the others. I know it's a lot to ask but I'm going crazy
can someone
steer me in the right direction ?




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 61
Default my macro is clearing the wrong sheet

A wild guess to your problem is that you haven't reference the sheet
correctly where you want the code to run.

There are 2 options here.

1. activate the worksheet where you want to code to execute.
Sub My Macro
Worksheets("Data").activate 'data is the sheets name, put this code before
the rest.

'your code

End sub

2. learn to use

Sub MyMacro()
Dim item as range

With Worksheets("Data") ' data is just the sheets name
item = .range("i4:j4") 'you must use the . or it will use the data from
the active worksheet

End with

End sub

by learnig to use the above its alot easier getting data from all over the
workbook

have fun

"Polarbear" wrote in message
...
Not sure how to do that -- I'm not too good at writting macros other than
just recording what I do -- mistakes scrolling and all -- I printed the
macro
it took up over two pages but i can try to past it here if it fits ?

Range("I4:J4").Select
Selection.Copy
ActiveWindow.SmallScroll ToRight:=6



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 226
Default my macro is clearing the wrong sheet

To add to David's comments, with VBA you can manipulate the sheets without
actually
selecting or unhiding them. So a chunk of your code eg:

Sheets("Misc policies & procedures ").Visible = True
Range("D22").Select
Selection.ClearContents
Range("D3:D19").Select
Range("D19").Activate
Selection.ClearContents
Range("D3").Select
Sheets("Misc policies & procedures ").Visible = False

could be rewritten as:

With Sheets("Misc policies & procedures ")
.Range("D22").ClearContents
.Range("D3:D19").ClearContents
End With

I hope this helps
Rowan

"Polarbear" wrote:

Not sure how to do that -- I'm not too good at writting macros other than
just recording what I do -- mistakes scrolling and all -- I printed the macro
it took up over two pages but i can try to past it here if it fits ?

Range("I4:J4").Select
Selection.Copy
ActiveWindow.SmallScroll ToRight:=6
ActiveWindow.SmallScroll Down:=9
Range("W24:X24").Select
Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _
xlNone, SkipBlanks:=False, Transpose:=False
Range("U26:Z26").Select
Application.CutCopyMode = False
Selection.Copy
ActiveWindow.SmallScroll ToRight:=-9
ActiveWindow.SmallScroll Down:=22
Range("B35:G35").Select
Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _
xlNone, SkipBlanks:=False, Transpose:=False
Range("B26:G35").Select
Range("F35").Activate
Application.CutCopyMode = False
Selection.Sort Key1:=Range("F26"), Order1:=xlDescending, Key2:=Range( _
"D26"), Order2:=xlDescending, Header:=xlGuess, OrderCustom:=1,
MatchCase _
:=False, Orientation:=xlTopToBottom, DataOption1:=xlSortNormal, _
DataOption2:=xlSortNormal
Range("D31:E31").Select
Sheets("Shift Leader Test").Visible = True
Sheets("Menu Standards").Visible = True

Range("B6,B6:C14,E6:F16,H6:I15,K6:L13,B20:C24,E22: F27,H21:I24,K19:L25").Select
Range("K19").Activate
ActiveWindow.SmallScroll Down:=15
Range( _

"B6,B6:C14,E6:F16,H6:I15,K6:L13,B20:C24,E22:F27,H2 1:I24,K19:L25,B30:C35,E33:F39,H30:I33,K31:L39,H39: I43,B41:C49,E45:F51,H49:I57,K45:L52,B55:C61,E57:F6 2" _
).Select
Range("E57").Activate
Selection.ClearContents
ActiveWindow.SmallScroll Down:=9
Range("E68").Select
Selection.ClearContents
Sheets("Time, temp & thawing").Visible = True
Range("D41").Select
Selection.ClearContents
Range("D3:D38").Select
Range("D38").Activate
Selection.ClearContents
ActiveWindow.SmallScroll Down:=-36
Range("D3").Select
Sheets("Misc policies & procedures ").Visible = True
Range("D22").Select
Selection.ClearContents
Range("D3:D19").Select
Range("D19").Activate
Selection.ClearContents
ActiveWindow.ScrollRow = 12
ActiveWindow.ScrollRow = 11
ActiveWindow.ScrollRow = 10
ActiveWindow.ScrollRow = 9
ActiveWindow.ScrollRow = 8
ActiveWindow.ScrollRow = 7
ActiveWindow.ScrollRow = 6
ActiveWindow.ScrollRow = 5
ActiveWindow.ScrollRow = 4
ActiveWindow.ScrollRow = 3
ActiveWindow.ScrollRow = 2
ActiveWindow.ScrollRow = 1
Range("D3").Select
Sheets("food handling ").Visible = True
Range("D25").Select
Selection.ClearContents
Range("D3:D22").Select
Range("D22").Activate
Selection.ClearContents
ActiveWindow.LargeScroll Down:=-2
Range("D3").Select
Sheets("guest service").Visible = True
Range("D3:D22").Select
Selection.ClearContents
ActiveWindow.LargeScroll Down:=2
Range("D25").Select
Selection.ClearContents
ActiveWindow.LargeScroll Down:=-1
ActiveWindow.ScrollRow = 9
ActiveWindow.ScrollRow = 8
ActiveWindow.ScrollRow = 7
ActiveWindow.ScrollRow = 6
ActiveWindow.ScrollRow = 5
ActiveWindow.ScrollRow = 4
ActiveWindow.ScrollRow = 3
ActiveWindow.ScrollRow = 2
ActiveWindow.ScrollRow = 1
Range("D3").Select
Sheets("Shift Leader Test").Select
Range("B4").Select
Selection.ClearContents
Range("D4").Select
Selection.ClearContents
ActiveWindow.SmallScroll Down:=6
Range("D19:F19").Select
Selection.ClearContents
Sheets("total score ").Select
ActiveWindow.SmallScroll Down:=-15
Sheets(Array("food handling ", "Misc policies & procedures ", _
"Time, temp & thawing", "Menu Standards", "total score ")).Select
Sheets("total score ").Activate
ActiveWindow.ScrollWorkbookTabs Sheets:=-1
ActiveWindow.ScrollWorkbookTabs Sheets:=-1
Sheets(Array("guest service", "food handling ", "Misc policies &
procedures ", _
"Time, temp & thawing", "Menu Standards", "total score ")).Select
Sheets("total score ").Activate
ActiveWindow.SelectedSheets.Visible = False
ActiveWindow.SmallScroll Down:=-21
Range("B4").Select
ActiveWorkbook.Save
End Sub


"Tim Williams" wrote:

post the problem code

Tim

"Polarbear" wrote in message
...
I wrote a multiple choice tests in excel, it's 7 pages multiple
choice with
in cell pull down answer selections. It's also timed which affects
your score
if your fast or slow. It also keeps track of the top 10 scores. It
has 6
macros that record the time, hide the sheet your one and open the
next sheet.
The scores, including times and top 10 are listed on the final sheet
which
is just a total sheet. It works perfectly up to that point -- I
tried to
record one last macro to reset it ie add new results to top ten
list -- print
totals, clear answers, and save it blank on the first page ready
for some
one else to take. The final macro I have written about 6 times I
hit record
do everything I want it to do, but when i run it, it randomly
clears most of
the cells on the total sheet. The total sheet is not selected when
I'm
clearing the others. I know it's a lot to ask but I'm going crazy
can someone
steer me in the right direction ?






  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default my macro is clearing the wrong sheet

Thanks you guys I will fix it in the morning


"Rowan" wrote:

To add to David's comments, with VBA you can manipulate the sheets without
actually
selecting or unhiding them. So a chunk of your code eg:

Sheets("Misc policies & procedures ").Visible = True
Range("D22").Select
Selection.ClearContents
Range("D3:D19").Select
Range("D19").Activate
Selection.ClearContents
Range("D3").Select
Sheets("Misc policies & procedures ").Visible = False

could be rewritten as:

With Sheets("Misc policies & procedures ")
.Range("D22").ClearContents
.Range("D3:D19").ClearContents
End With

I hope this helps
Rowan

"Polarbear" wrote:

Not sure how to do that -- I'm not too good at writting macros other than
just recording what I do -- mistakes scrolling and all -- I printed the macro
it took up over two pages but i can try to past it here if it fits ?

Range("I4:J4").Select
Selection.Copy
ActiveWindow.SmallScroll ToRight:=6
ActiveWindow.SmallScroll Down:=9
Range("W24:X24").Select
Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _
xlNone, SkipBlanks:=False, Transpose:=False
Range("U26:Z26").Select
Application.CutCopyMode = False
Selection.Copy
ActiveWindow.SmallScroll ToRight:=-9
ActiveWindow.SmallScroll Down:=22
Range("B35:G35").Select
Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _
xlNone, SkipBlanks:=False, Transpose:=False
Range("B26:G35").Select
Range("F35").Activate
Application.CutCopyMode = False
Selection.Sort Key1:=Range("F26"), Order1:=xlDescending, Key2:=Range( _
"D26"), Order2:=xlDescending, Header:=xlGuess, OrderCustom:=1,
MatchCase _
:=False, Orientation:=xlTopToBottom, DataOption1:=xlSortNormal, _
DataOption2:=xlSortNormal
Range("D31:E31").Select
Sheets("Shift Leader Test").Visible = True
Sheets("Menu Standards").Visible = True

Range("B6,B6:C14,E6:F16,H6:I15,K6:L13,B20:C24,E22: F27,H21:I24,K19:L25").Select
Range("K19").Activate
ActiveWindow.SmallScroll Down:=15
Range( _

"B6,B6:C14,E6:F16,H6:I15,K6:L13,B20:C24,E22:F27,H2 1:I24,K19:L25,B30:C35,E33:F39,H30:I33,K31:L39,H39: I43,B41:C49,E45:F51,H49:I57,K45:L52,B55:C61,E57:F6 2" _
).Select
Range("E57").Activate
Selection.ClearContents
ActiveWindow.SmallScroll Down:=9
Range("E68").Select
Selection.ClearContents
Sheets("Time, temp & thawing").Visible = True
Range("D41").Select
Selection.ClearContents
Range("D3:D38").Select
Range("D38").Activate
Selection.ClearContents
ActiveWindow.SmallScroll Down:=-36
Range("D3").Select
Sheets("Misc policies & procedures ").Visible = True
Range("D22").Select
Selection.ClearContents
Range("D3:D19").Select
Range("D19").Activate
Selection.ClearContents
ActiveWindow.ScrollRow = 12
ActiveWindow.ScrollRow = 11
ActiveWindow.ScrollRow = 10
ActiveWindow.ScrollRow = 9
ActiveWindow.ScrollRow = 8
ActiveWindow.ScrollRow = 7
ActiveWindow.ScrollRow = 6
ActiveWindow.ScrollRow = 5
ActiveWindow.ScrollRow = 4
ActiveWindow.ScrollRow = 3
ActiveWindow.ScrollRow = 2
ActiveWindow.ScrollRow = 1
Range("D3").Select
Sheets("food handling ").Visible = True
Range("D25").Select
Selection.ClearContents
Range("D3:D22").Select
Range("D22").Activate
Selection.ClearContents
ActiveWindow.LargeScroll Down:=-2
Range("D3").Select
Sheets("guest service").Visible = True
Range("D3:D22").Select
Selection.ClearContents
ActiveWindow.LargeScroll Down:=2
Range("D25").Select
Selection.ClearContents
ActiveWindow.LargeScroll Down:=-1
ActiveWindow.ScrollRow = 9
ActiveWindow.ScrollRow = 8
ActiveWindow.ScrollRow = 7
ActiveWindow.ScrollRow = 6
ActiveWindow.ScrollRow = 5
ActiveWindow.ScrollRow = 4
ActiveWindow.ScrollRow = 3
ActiveWindow.ScrollRow = 2
ActiveWindow.ScrollRow = 1
Range("D3").Select
Sheets("Shift Leader Test").Select
Range("B4").Select
Selection.ClearContents
Range("D4").Select
Selection.ClearContents
ActiveWindow.SmallScroll Down:=6
Range("D19:F19").Select
Selection.ClearContents
Sheets("total score ").Select
ActiveWindow.SmallScroll Down:=-15
Sheets(Array("food handling ", "Misc policies & procedures ", _
"Time, temp & thawing", "Menu Standards", "total score ")).Select
Sheets("total score ").Activate
ActiveWindow.ScrollWorkbookTabs Sheets:=-1
ActiveWindow.ScrollWorkbookTabs Sheets:=-1
Sheets(Array("guest service", "food handling ", "Misc policies &
procedures ", _
"Time, temp & thawing", "Menu Standards", "total score ")).Select
Sheets("total score ").Activate
ActiveWindow.SelectedSheets.Visible = False
ActiveWindow.SmallScroll Down:=-21
Range("B4").Select
ActiveWorkbook.Save
End Sub


"Tim Williams" wrote:

post the problem code

Tim

"Polarbear" wrote in message
...
I wrote a multiple choice tests in excel, it's 7 pages multiple
choice with
in cell pull down answer selections. It's also timed which affects
your score
if your fast or slow. It also keeps track of the top 10 scores. It
has 6
macros that record the time, hide the sheet your one and open the
next sheet.
The scores, including times and top 10 are listed on the final sheet
which
is just a total sheet. It works perfectly up to that point -- I
tried to
record one last macro to reset it ie add new results to top ten
list -- print
totals, clear answers, and save it blank on the first page ready
for some
one else to take. The final macro I have written about 6 times I
hit record
do everything I want it to do, but when i run it, it randomly
clears most of
the cells on the total sheet. The total sheet is not selected when
I'm
clearing the others. I know it's a lot to ask but I'm going crazy
can someone
steer me in the right direction ?



  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default my macro is clearing the wrong sheet

I fixed and it works perfectly I guess like you said when I unhide sheet my
cursor is on the new sheet but it cleared the same cells on both sheets I
think. I re wrote the macro to open all hidden sheets first, then when i
selected them by the tab the macro recorded correctly. Thanks for your help.

"Polarbear" wrote:

Thanks you guys I will fix it in the morning


"Rowan" wrote:

To add to David's comments, with VBA you can manipulate the sheets without
actually
selecting or unhiding them. So a chunk of your code eg:

Sheets("Misc policies & procedures ").Visible = True
Range("D22").Select
Selection.ClearContents
Range("D3:D19").Select
Range("D19").Activate
Selection.ClearContents
Range("D3").Select
Sheets("Misc policies & procedures ").Visible = False

could be rewritten as:

With Sheets("Misc policies & procedures ")
.Range("D22").ClearContents
.Range("D3:D19").ClearContents
End With

I hope this helps
Rowan

"Polarbear" wrote:

Not sure how to do that -- I'm not too good at writting macros other than
just recording what I do -- mistakes scrolling and all -- I printed the macro
it took up over two pages but i can try to past it here if it fits ?

Range("I4:J4").Select
Selection.Copy
ActiveWindow.SmallScroll ToRight:=6
ActiveWindow.SmallScroll Down:=9
Range("W24:X24").Select
Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _
xlNone, SkipBlanks:=False, Transpose:=False
Range("U26:Z26").Select
Application.CutCopyMode = False
Selection.Copy
ActiveWindow.SmallScroll ToRight:=-9
ActiveWindow.SmallScroll Down:=22
Range("B35:G35").Select
Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _
xlNone, SkipBlanks:=False, Transpose:=False
Range("B26:G35").Select
Range("F35").Activate
Application.CutCopyMode = False
Selection.Sort Key1:=Range("F26"), Order1:=xlDescending, Key2:=Range( _
"D26"), Order2:=xlDescending, Header:=xlGuess, OrderCustom:=1,
MatchCase _
:=False, Orientation:=xlTopToBottom, DataOption1:=xlSortNormal, _
DataOption2:=xlSortNormal
Range("D31:E31").Select
Sheets("Shift Leader Test").Visible = True
Sheets("Menu Standards").Visible = True

Range("B6,B6:C14,E6:F16,H6:I15,K6:L13,B20:C24,E22: F27,H21:I24,K19:L25").Select
Range("K19").Activate
ActiveWindow.SmallScroll Down:=15
Range( _

"B6,B6:C14,E6:F16,H6:I15,K6:L13,B20:C24,E22:F27,H2 1:I24,K19:L25,B30:C35,E33:F39,H30:I33,K31:L39,H39: I43,B41:C49,E45:F51,H49:I57,K45:L52,B55:C61,E57:F6 2" _
).Select
Range("E57").Activate
Selection.ClearContents
ActiveWindow.SmallScroll Down:=9
Range("E68").Select
Selection.ClearContents
Sheets("Time, temp & thawing").Visible = True
Range("D41").Select
Selection.ClearContents
Range("D3:D38").Select
Range("D38").Activate
Selection.ClearContents
ActiveWindow.SmallScroll Down:=-36
Range("D3").Select
Sheets("Misc policies & procedures ").Visible = True
Range("D22").Select
Selection.ClearContents
Range("D3:D19").Select
Range("D19").Activate
Selection.ClearContents
ActiveWindow.ScrollRow = 12
ActiveWindow.ScrollRow = 11
ActiveWindow.ScrollRow = 10
ActiveWindow.ScrollRow = 9
ActiveWindow.ScrollRow = 8
ActiveWindow.ScrollRow = 7
ActiveWindow.ScrollRow = 6
ActiveWindow.ScrollRow = 5
ActiveWindow.ScrollRow = 4
ActiveWindow.ScrollRow = 3
ActiveWindow.ScrollRow = 2
ActiveWindow.ScrollRow = 1
Range("D3").Select
Sheets("food handling ").Visible = True
Range("D25").Select
Selection.ClearContents
Range("D3:D22").Select
Range("D22").Activate
Selection.ClearContents
ActiveWindow.LargeScroll Down:=-2
Range("D3").Select
Sheets("guest service").Visible = True
Range("D3:D22").Select
Selection.ClearContents
ActiveWindow.LargeScroll Down:=2
Range("D25").Select
Selection.ClearContents
ActiveWindow.LargeScroll Down:=-1
ActiveWindow.ScrollRow = 9
ActiveWindow.ScrollRow = 8
ActiveWindow.ScrollRow = 7
ActiveWindow.ScrollRow = 6
ActiveWindow.ScrollRow = 5
ActiveWindow.ScrollRow = 4
ActiveWindow.ScrollRow = 3
ActiveWindow.ScrollRow = 2
ActiveWindow.ScrollRow = 1
Range("D3").Select
Sheets("Shift Leader Test").Select
Range("B4").Select
Selection.ClearContents
Range("D4").Select
Selection.ClearContents
ActiveWindow.SmallScroll Down:=6
Range("D19:F19").Select
Selection.ClearContents
Sheets("total score ").Select
ActiveWindow.SmallScroll Down:=-15
Sheets(Array("food handling ", "Misc policies & procedures ", _
"Time, temp & thawing", "Menu Standards", "total score ")).Select
Sheets("total score ").Activate
ActiveWindow.ScrollWorkbookTabs Sheets:=-1
ActiveWindow.ScrollWorkbookTabs Sheets:=-1
Sheets(Array("guest service", "food handling ", "Misc policies &
procedures ", _
"Time, temp & thawing", "Menu Standards", "total score ")).Select
Sheets("total score ").Activate
ActiveWindow.SelectedSheets.Visible = False
ActiveWindow.SmallScroll Down:=-21
Range("B4").Select
ActiveWorkbook.Save
End Sub


"Tim Williams" wrote:

post the problem code

Tim

"Polarbear" wrote in message
...
I wrote a multiple choice tests in excel, it's 7 pages multiple
choice with
in cell pull down answer selections. It's also timed which affects
your score
if your fast or slow. It also keeps track of the top 10 scores. It
has 6
macros that record the time, hide the sheet your one and open the
next sheet.
The scores, including times and top 10 are listed on the final sheet
which
is just a total sheet. It works perfectly up to that point -- I
tried to
record one last macro to reset it ie add new results to top ten
list -- print
totals, clear answers, and save it blank on the first page ready
for some
one else to take. The final macro I have written about 6 times I
hit record
do everything I want it to do, but when i run it, it randomly
clears most of
the cells on the total sheet. The total sheet is not selected when
I'm
clearing the others. I know it's a lot to ask but I'm going crazy
can someone
steer me in the right direction ?



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
clearing data from excell sheet A Excel Discussion (Misc queries) 3 January 28th 08 04:09 PM
need to modify a macro to prevent it from executing if in wrong area of the sheet Tonso Excel Discussion (Misc queries) 3 February 11th 07 08:00 PM
Clearing old data from a sheet 5lmustang[_2_] Excel Programming 0 October 26th 04 12:18 AM
Clearing old data from a sheet 5lmustang Excel Programming 1 October 20th 04 02:17 AM
macro? clearing/ transferring info to another sheet asm Excel Programming 0 November 24th 03 03:58 AM


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