Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
VBA Function
How to combine 3 macros to run together. First, I would like to unprotect
all sheets for which I am using the following macro: Sub unprotectAll() Dim myCount Dim i myCount = Application.Sheets.Count Sheets(1).Select For i = 1 To myCount ActiveSheet.Unprotect Password:="1" If i = myCount Then End End If ActiveSheet.Next.Select Next i End Sub Then, I would like to copy and paste values for the entire sheets 22-26 for which I am trying to use this macro but getting errors: Sub CopyRange() Dim myCount Dim i myCount = Application.Sheets.Count Sheets(22).Select For i = 22 To myCount ActiveSheet.Range("A1:IV5000").Paste values Destination:=Range("A1:IV5000") End Sub Then, I would like delete sheets 1-21, for which I am not sure about the routine. Some important things to note are that the sheets are not called €śsheet 1€ť, €śsheet 2€ť, etc, but have specific names. The sequence of the sheets in the file does not change however, so I believe it would be simpler to identify them by number, correct? Finally, how to run this as one routine, rather than 3 separate macros? -- iperlovsky |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
copy of excel file not showing formulal/function in the function b | Excel Discussion (Misc queries) | |||
LINKEDRANGE function - a complement to the PULL function (for getting values from a closed workbook) | Excel Worksheet Functions | |||
Offset function with nested match function not finding host ss. | Excel Worksheet Functions | |||
Emulate Index/Match combo function w/ VBA custom function | Excel Worksheet Functions | |||
Nested IF Function, Date Comparing, and NetworkDays Function | Excel Worksheet Functions |