Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Macros?
Ok I have a worksheet that alot of info is input daily. Each day it is saved
with a new name and there is a macro recorded to delete the previous days info and then we put in the new info. In some blocks there are numbers that are copied and put in another block, ie dates and meters. Somehow some of the blocks arnt doing what they are supposed too so I'm trying to go through and redo it. I know how to do the special paste to transfer the info over but when I try to reset it, because the blocks are formated to be locked, it will say something about debuging. How do I make it to where it will paste the info and keep the blocked locked? It was done before with the old sheet so I know it can be done, I just don't know how. Thank you for any help! |
#2
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Macros?
On Fri, 21 Apr 2006 01:34:01 -0700, Engli360
wrote: Ok I have a worksheet that alot of info is input daily. Each day it is saved with a new name and there is a macro recorded to delete the previous days info and then we put in the new info. In some blocks there are numbers that are copied and put in another block, ie dates and meters. Somehow some of the blocks arnt doing what they are supposed too so I'm trying to go through and redo it. I know how to do the special paste to transfer the info over but when I try to reset it, because the blocks are formated to be locked, it will say something about debuging. How do I make it to where it will paste the info and keep the blocked locked? It was done before with the old sheet so I know it can be done, I just don't know how. Thank you for any help! When the macro halts with the End..Debug message, and you select the Debug option, what's the line of code that is highlighted? Rgds __ Richard Buttrey Grappenhall, Cheshire, UK __________________________ |
#3
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Macros?
"Richard Buttrey" wrote: On Fri, 21 Apr 2006 01:34:01 -0700, Engli360 wrote: Ok I have a worksheet that alot of info is input daily. Each day it is saved with a new name and there is a macro recorded to delete the previous days info and then we put in the new info. In some blocks there are numbers that are copied and put in another block, ie dates and meters. Somehow some of the blocks arnt doing what they are supposed too so I'm trying to go through and redo it. I know how to do the special paste to transfer the info over but when I try to reset it, because the blocks are formated to be locked, it will say something about debuging. How do I make it to where it will paste the info and keep the blocked locked? It was done before with the old sheet so I know it can be done, I just don't know how. Thank you for any help! When the macro halts with the End..Debug message, and you select the Debug option, what's the line of code that is highlighted? Rgds __ Richard Buttrey Grappenhall, Cheshire, UK Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _ :=True, Transpose:=False I copied that from the Visual Basic when it opened after I selected debug. __________________________ |
#4
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Macros?
Are you saying that the cells that the values are trying to be
paste/specialed into are locked? If that is the case, that is why the macro is failing. You have to unprotect the sheet in order for the paste/special to work on locked cells. Either you can do it manually before you run the macro, or you can edit the macro so that it unprotects the sheet and then reprotects is after it is done. "Engli360" wrote: "Richard Buttrey" wrote: On Fri, 21 Apr 2006 01:34:01 -0700, Engli360 wrote: Ok I have a worksheet that alot of info is input daily. Each day it is saved with a new name and there is a macro recorded to delete the previous days info and then we put in the new info. In some blocks there are numbers that are copied and put in another block, ie dates and meters. Somehow some of the blocks arnt doing what they are supposed too so I'm trying to go through and redo it. I know how to do the special paste to transfer the info over but when I try to reset it, because the blocks are formated to be locked, it will say something about debuging. How do I make it to where it will paste the info and keep the blocked locked? It was done before with the old sheet so I know it can be done, I just don't know how. Thank you for any help! When the macro halts with the End..Debug message, and you select the Debug option, what's the line of code that is highlighted? Rgds __ Richard Buttrey Grappenhall, Cheshire, UK Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _ :=True, Transpose:=False I copied that from the Visual Basic when it opened after I selected debug. __________________________ |
#5
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Macros?
As William says, it sound like you need to add something like the
following to your code. ActiveSheet.Unprotect 'After the code that does the copying and pasting, i.e. Range("MyRange1").Copy Range("MyRange2").PasteSpecial (xlPasteValues) 'add Range("MyRange2").Locked = True ' to reprotect the range ActiveSheet.Protect HTH On Fri, 21 Apr 2006 06:19:01 -0700, William Horton wrote: Are you saying that the cells that the values are trying to be paste/specialed into are locked? If that is the case, that is why the macro is failing. You have to unprotect the sheet in order for the paste/special to work on locked cells. Either you can do it manually before you run the macro, or you can edit the macro so that it unprotects the sheet and then reprotects is after it is done. "Engli360" wrote: "Richard Buttrey" wrote: On Fri, 21 Apr 2006 01:34:01 -0700, Engli360 wrote: Ok I have a worksheet that alot of info is input daily. Each day it is saved with a new name and there is a macro recorded to delete the previous days info and then we put in the new info. In some blocks there are numbers that are copied and put in another block, ie dates and meters. Somehow some of the blocks arnt doing what they are supposed too so I'm trying to go through and redo it. I know how to do the special paste to transfer the info over but when I try to reset it, because the blocks are formated to be locked, it will say something about debuging. How do I make it to where it will paste the info and keep the blocked locked? It was done before with the old sheet so I know it can be done, I just don't know how. Thank you for any help! When the macro halts with the End..Debug message, and you select the Debug option, what's the line of code that is highlighted? Rgds __ Richard Buttrey Grappenhall, Cheshire, UK Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _ :=True, Transpose:=False I copied that from the Visual Basic when it opened after I selected debug. __________________________ __ Richard Buttrey Grappenhall, Cheshire, UK __________________________ |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
how do I run excel 4.0 macros on excel 2000 | Excel Discussion (Misc queries) | |||
Excel crashes while opening excel file imbeddied with macros | Excel Discussion (Misc queries) | |||
Macros, How do I know what they do if I didn't create them. | Excel Discussion (Misc queries) | |||
Enabling macros | Excel Discussion (Misc queries) | |||
Transferring toolbars and macros to other computers | Excel Discussion (Misc queries) |