Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
Running a Macro that enters a function that returns #VALUE!
In Help I get the answer as "Make sure the function is not running an
incorrect argument". this would make sense if there was a way to find out if the macro is running an incorrect agrument. There is no Trace Error button that appears. The error first showed up in Column H and then when I copied Values it showed up in Column C. This macro is set to 1: Copy the values only from Column H to Column C (this is a calculated field (=IF(COUNTA(A2:G2)=0,"",SUM(C2-F2)+D2)) and then 3: clear the contents of Columns D2000:G2000. Is there a reason that I am getting this error? Here is my macro: Sub ClearWorkSheet() ' ' ClearWorkSheet Macro ' Macro recorded 12/29/2006 by ADMIN ' ' Keyboard Shortcut: Ctrl+q ' Range("H2:H2000").Select Selection.Copy Range("D5").Select ActiveWindow.SmallScroll Down:=-11 Range("D2:G2000").Select Application.CutCopyMode = False Selection.ClearContents Range("F2004").Select ActiveWindow.SmallScroll Down:=-25 Range("A2").Select End Sub |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
Running a Macro that enters a function that returns #VALUE!
In theory that looks good, if I had any idea where to put it? (I am a novice
when it comes to macros) Does it go into the actual macro? Do I create something else? I look forward to your response :) "Don Guillett" wrote: something like? sub trythis() 'NO selections range("c2:c22").value=range("h2:h22").value range("d2:g22").clearcontents end sub -- Don Guillett SalesAid Software "gevew" wrote in message ... In Help I get the answer as "Make sure the function is not running an incorrect argument". this would make sense if there was a way to find out if the macro is running an incorrect agrument. There is no Trace Error button that appears. The error first showed up in Column H and then when I copied Values it showed up in Column C. This macro is set to 1: Copy the values only from Column H to Column C (this is a calculated field (=IF(COUNTA(A2:G2)=0,"",SUM(C2-F2)+D2)) and then 3: clear the contents of Columns D2000:G2000. Is there a reason that I am getting this error? Here is my macro: Sub ClearWorkSheet() ' ' ClearWorkSheet Macro ' Macro recorded 12/29/2006 by ADMIN ' ' Keyboard Shortcut: Ctrl+q ' Range("H2:H2000").Select Selection.Copy Range("D5").Select ActiveWindow.SmallScroll Down:=-11 Range("D2:G2000").Select Application.CutCopyMode = False Selection.ClearContents Range("F2004").Select ActiveWindow.SmallScroll Down:=-25 Range("A2").Select End Sub |
#4
Posted to microsoft.public.excel.misc
|
|||
|
|||
Running a Macro that enters a function that returns #VALUE!
Just take the two lines of code that Don has given between his Sub... and End
Sub statements and replace the code within your own recorded macro with them. His does what you want without all the extra overhead of keeping up with every scroll motion you made while recording that macro. "gevew" wrote: In theory that looks good, if I had any idea where to put it? (I am a novice when it comes to macros) Does it go into the actual macro? Do I create something else? I look forward to your response :) "Don Guillett" wrote: something like? sub trythis() 'NO selections range("c2:c22").value=range("h2:h22").value range("d2:g22").clearcontents end sub -- Don Guillett SalesAid Software "gevew" wrote in message ... In Help I get the answer as "Make sure the function is not running an incorrect argument". this would make sense if there was a way to find out if the macro is running an incorrect agrument. There is no Trace Error button that appears. The error first showed up in Column H and then when I copied Values it showed up in Column C. This macro is set to 1: Copy the values only from Column H to Column C (this is a calculated field (=IF(COUNTA(A2:G2)=0,"",SUM(C2-F2)+D2)) and then 3: clear the contents of Columns D2000:G2000. Is there a reason that I am getting this error? Here is my macro: Sub ClearWorkSheet() ' ' ClearWorkSheet Macro ' Macro recorded 12/29/2006 by ADMIN ' ' Keyboard Shortcut: Ctrl+q ' Range("H2:H2000").Select Selection.Copy Range("D5").Select ActiveWindow.SmallScroll Down:=-11 Range("D2:G2000").Select Application.CutCopyMode = False Selection.ClearContents Range("F2004").Select ActiveWindow.SmallScroll Down:=-25 Range("A2").Select End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Macro Help (Uppercase multiple ranges?) | Excel Discussion (Misc queries) | |||
disable user running macro from Tools Macro | Excel Discussion (Misc queries) | |||
How can I invoke running a macro from within an "IF" function. | Excel Worksheet Functions | |||
Closing File Error | Excel Discussion (Misc queries) | |||
GET.CELL | Excel Worksheet Functions |