LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How can I use this VB script to reset my values on other sheets?


Hello

I have this VB script that resets all my values on the sheet that m
Reset Button resides (shown below)
However, this spreadsheet has 3 different sheets, and I would like t
be able to reset the variable values on the other sheets as well wit
the one button.

I am using the script below. Any help on how to make it reset th
others sheets as well would be very much appreciated.

Thanking you in advance
Trilogy


Dim CellArray
Dim ValueArray
Dim ErrorCheck

CellArray = Array("B1:C1", "B2:C2",..... etc)
ValueArray = Array("", "",... etc)


ErrorCheck = False

If UBound(CellArray) < UBound(ValueArray) Then
MessageString = "Data Mismatch in Cell Arrays - Please ensur
there is a matching value for each cell listed in 'CellArray'" & vbCrL
& "There are currently " & UBound(CellArray) & " CELL assignments and
& UBound(ValueArray) & " VALUE assignments"
MsgBox (MessageString)
ErrorCheck = True
End If


If Not ErrorCheck Then

For i = o To UBound(CellArray)

Range(CellArray(i)).Select
ActiveCell.FormulaR1C1 = ValueArray(i)


If InStr(CellArray(i), ":") 0 Then

CellRange = Split(CellArray(i), ":")
StartRow = Right(CellRange(0), Len(CellRange(0)) - 1)
EndRow = Right(CellRange(1), Len(CellRange(1)) - 1)

If StartRow < EndRow Then

Selection.FillDown

End If

End If


Next

End If

Range("B1:C1").Select

End Su

--
trilog
-----------------------------------------------------------------------
trilogy's Profile: http://www.excelforum.com/member.php...fo&userid=3683
View this thread: http://www.excelforum.com/showthread.php?threadid=56820

 
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 can i reset excel to its default values? Tiffany Thai Excel Worksheet Functions 1 February 25th 09 11:39 PM
How do I reset options to default values BruceC Excel Discussion (Misc queries) 1 November 6th 05 10:11 PM
set or reset the print range for several sheets at a time? Mestrella31 Excel Discussion (Misc queries) 2 January 10th 05 09:07 PM
how do you set or reset the print range for several sheets at a ti Mestrella31 Excel Programming 2 January 10th 05 05:28 PM
Using For Next to reset Pge Brk Preview on all sheets Far Excel Programming 4 April 22nd 04 05:02 PM


All times are GMT +1. The time now is 09:30 AM.

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"