#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Engli360
 
Posts: n/a
Default 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   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Richard Buttrey
 
Posts: n/a
Default 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   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Engli360
 
Posts: n/a
Default 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   Report Post  
Posted to microsoft.public.excel.worksheet.functions
William Horton
 
Posts: n/a
Default 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   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Richard Buttrey
 
Posts: n/a
Default 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
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 do I run excel 4.0 macros on excel 2000 RodolfoDallas Excel Discussion (Misc queries) 1 March 12th 06 03:14 AM
Excel crashes while opening excel file imbeddied with macros ct2147 Excel Discussion (Misc queries) 0 December 30th 05 09:05 PM
Macros, How do I know what they do if I didn't create them. Abelg Excel Discussion (Misc queries) 1 September 17th 05 05:57 PM
Enabling macros Peter M Excel Discussion (Misc queries) 3 February 7th 05 10:57 PM
Transferring toolbars and macros to other computers Darrell Excel Discussion (Misc queries) 1 January 19th 05 12:21 AM


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