Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8
Default 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   Report Post  
Posted to microsoft.public.excel.misc
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




  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,365
Default 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
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
Macro Help (Uppercase multiple ranges?) Ken Excel Discussion (Misc queries) 14 December 2nd 06 07:23 PM
disable user running macro from Tools Macro Steve Simons Excel Discussion (Misc queries) 4 September 28th 06 06:28 AM
How can I invoke running a macro from within an "IF" function. ron Excel Worksheet Functions 11 February 8th 06 03:35 PM
Closing File Error jcliquidtension Excel Discussion (Misc queries) 4 October 20th 05 12:22 PM
GET.CELL Biff Excel Worksheet Functions 2 November 24th 04 07:16 PM


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