PC Review


Reply
Thread Tools Rate Thread

cannot record macro

 
 
=?Utf-8?B?c3RldmVu?=
Guest
Posts: n/a
 
      21st Feb 2007
Hello i am trying to record a macro with the recorder but i get a "cannot
record macro" error message.

the formula i am trying to record is (this is the way it looks in excel
mode) :

IF(OR(E2="11 - MARKETING XXXXXXXX";E2="12 - MARKETING XXXXXXXXXX";E2="13 -
INTERNATIONAL MARKETING";E2="14-
XXXXXXXXXXXXX");VLOOKUP(H2;'[MARKETNGHELP.xls]vlookup'!$P:$Q;2;FALSE);VLOOKUP(E2;'[MARKEINGHELP.xls]vlookup'!$I:$J;2;FALSE))

why can't i record it? can someone give me the code to paste it directly in
a module?

thank you.

Steven.
 
Reply With Quote
 
 
 
 
=?Utf-8?B?QW5keSBTbWl0aA==?=
Guest
Posts: n/a
 
      21st Feb 2007
You, and therefore I, am a little confused. You don't record formulas, you
only record macros. It seems like you have the formula you want (except that
all the semicolons should be commas), so what's to record? Or are you trying
to translate the formula into VBA code?

Maybe you should look at Application.WorksheetFunction.

--

--Andy Smith



"steven" wrote:

> Hello i am trying to record a macro with the recorder but i get a "cannot
> record macro" error message.
>
> the formula i am trying to record is (this is the way it looks in excel
> mode) :
>
> IF(OR(E2="11 - MARKETING XXXXXXXX";E2="12 - MARKETING XXXXXXXXXX";E2="13 -
> INTERNATIONAL MARKETING";E2="14-
> XXXXXXXXXXXXX");VLOOKUP(H2;'[MARKETNGHELP.xls]vlookup'!$P:$Q;2;FALSE);VLOOKUP(E2;'[MARKEINGHELP.xls]vlookup'!$I:$J;2;FALSE))
>
> why can't i record it? can someone give me the code to paste it directly in
> a module?
>
> thank you.
>
> Steven.

 
Reply With Quote
 
=?Utf-8?B?VG9tIE9naWx2eQ==?=
Guest
Posts: n/a
 
      21st Feb 2007
Sub ABC()
Dim s1 as String, s2 as String
s1 = "=IF(OR(E2=""11 - MARKETING XXXXXXXX"";E2" & _
"=""12 - MARKETING XXXXXXXXXX"";E2" & _
"=""13 - INTERNATIONAL MARKETING"";E2" & _
"=""14- XXXXXXXXXXXXX"");VLOOKUP(H2;" & _
"'[MARKETNGHELP.xls]vlookup'!$P:$Q;2;FALSE);" & _
"VLOOKUP(E2;'[MARKEINGHELP.xls]vlookup'!$I:$J;2;FALSE))"
s2 = Application.Replace(s1,";",",")
activecell.formula = s2
End sub

when using the formula property, the formula is entered using us English
conventions.

--
Regards,
Tom Ogilvy


"steven" wrote:

> Hello i am trying to record a macro with the recorder but i get a "cannot
> record macro" error message.
>
> the formula i am trying to record is (this is the way it looks in excel
> mode) :
>
> IF(OR(E2="11 - MARKETING XXXXXXXX";E2="12 - MARKETING XXXXXXXXXX";E2="13 -
> INTERNATIONAL MARKETING";E2="14-
> XXXXXXXXXXXXX");VLOOKUP(H2;'[MARKETNGHELP.xls]vlookup'!$P:$Q;2;FALSE);VLOOKUP(E2;'[MARKEINGHELP.xls]vlookup'!$I:$J;2;FALSE))
>
> why can't i record it? can someone give me the code to paste it directly in
> a module?
>
> thank you.
>
> Steven.

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Baffled, can record macro, and then RTE5. Macro works fine on another PC. Excel2007 boyd98 Webmaster / Programming 2 27th Sep 2011 05:53 PM
Record macro doesn't record shape properties Tosco Microsoft Excel Programming 3 30th May 2007 02:28 AM
Find a record and append it as a new record with a macro =?Utf-8?B?TmFyZXNoIEt1bWFyIFNhaW5p?= Microsoft Access Macros 2 6th Oct 2006 10:07 AM
Record Macro - Record custom user actions Sal Microsoft Excel Programming 1 23rd Dec 2004 03:18 PM
how to count/sum by function/macro to get the number of record to do copy/paste in macro tango Microsoft Excel Programming 1 15th Oct 2004 01:16 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:22 AM.