View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.misc
gevew gevew is offline
external usenet poster
 
Posts: 8
Default 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