Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Insert formula

Hello guys, I'm trying to place this formula in a cell:

=IF(ISNA(HLOOKUP($F$3&"\"&F7;'D:\Documents and
Settings\hz6tlm\Desktop\Users\[Users_snx6609.csv]Users_snx6609'!X:X;1;FALSE));"";"Admin")

Where the X:X is a variable coming from the worksheet...

I'm trying to use this code:

Sub Macro1()
Cells(6, 7).Select
Selection.Formula = "=IF(ISNA(HLOOKUP($F$3&"\"&F7;'D:\Documents and
Settings\hz6tlm\Desktop\Users\[Users_snx6609.csv]Users_snx6609'!$377:$377;1;FALSE));"";"Admin")"
End Sub

But it's getting a Syntax error... So I didn't even try to manipulate
the variable... This formula is actually working on the sheet...

Could anybody help me?

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default Insert formula

Try this

Sub Macro1()
Cells(6, 7).Formula = "=IF(ISNA(HLOOKUP($F$3&""\""&F7;'D:\Documents and
Settings\hz6tlm\Desktop\Users\[Users_snx6609.csv]Users_snx6609'!$377:$377;1;
FALSE));"""";""Admin"")"
End Sub


--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"josuegm" wrote in message
ups.com...
Hello guys, I'm trying to place this formula in a cell:

=IF(ISNA(HLOOKUP($F$3&"\"&F7;'D:\Documents and

Settings\hz6tlm\Desktop\Users\[Users_snx6609.csv]Users_snx6609'!X:X;1;FALSE)
);"";"Admin")

Where the X:X is a variable coming from the worksheet...

I'm trying to use this code:

Sub Macro1()
Cells(6, 7).Select
Selection.Formula = "=IF(ISNA(HLOOKUP($F$3&"\"&F7;'D:\Documents and

Settings\hz6tlm\Desktop\Users\[Users_snx6609.csv]Users_snx6609'!$377:$377;1;
FALSE));"";"Admin")"
End Sub

But it's getting a Syntax error... So I didn't even try to manipulate
the variable... This formula is actually working on the sheet...

Could anybody help me?



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,089
Default Insert formula

Try doubling up all the quotes except the first and the last

Selection.Formula = "=IF(ISNA(HLOOKUP($F$3&""\""&F7;'D:\Documents and
Settings\hz6tlm\Desktop\Users\[Users_snx6609.csv]Users_snx6609'!$377:$377;1;FALSE));"""";""Admin"") "


Regards

Trevor


"josuegm" wrote in message
ups.com...
Hello guys, I'm trying to place this formula in a cell:

=IF(ISNA(HLOOKUP($F$3&"\"&F7;'D:\Documents and
Settings\hz6tlm\Desktop\Users\[Users_snx6609.csv]Users_snx6609'!X:X;1;FALSE));"";"Admin")

Where the X:X is a variable coming from the worksheet...

I'm trying to use this code:

Sub Macro1()
Cells(6, 7).Select
Selection.Formula = "=IF(ISNA(HLOOKUP($F$3&"\"&F7;'D:\Documents and
Settings\hz6tlm\Desktop\Users\[Users_snx6609.csv]Users_snx6609'!$377:$377;1;FALSE));"";"Admin")"
End Sub

But it's getting a Syntax error... So I didn't even try to manipulate
the variable... This formula is actually working on the sheet...

Could anybody help me?



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Insert formula

Thanks for the assistance guys, but both things didn't worked...
Both'em display the following message error:

"Run-time error '1004':
Application-defined or object-defined error."

What's wrong? It seems so simple this code, just place a damn formula
in a cell! LOL... I had developed to do this search opening the
workbook and finding the contents, but it was taking a lot of time to
run completely.... So I thought that placing a formula would make
things easier... Indeed it does, but first the formula must be placed!
hahahahahaha...

Please guys, help me out!

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default Insert formula

Try this

Cells(6, 7).Formula = "=IF(ISNA(HLOOKUP($F$3&""\""&F7;" & _
"'D:\Documents and Settings\hz6tlm\Desktop\Users\[Users_snx6609.csv]" & _
"Users_snx6609'!$377:$377;1;FALSE));"""";""Admin"" )"

; is your statement separator in a formula, not , I assume?

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"josuegm" wrote in message
oups.com...
Thanks for the assistance guys, but both things didn't worked...
Both'em display the following message error:

"Run-time error '1004':
Application-defined or object-defined error."

What's wrong? It seems so simple this code, just place a damn formula
in a cell! LOL... I had developed to do this search opening the
workbook and finding the contents, but it was taking a lot of time to
run completely.... So I thought that placing a formula would make
things easier... Indeed it does, but first the formula must be placed!
hahahahahaha...

Please guys, help me out!



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
Insert formula John Excel Discussion (Misc queries) 3 May 25th 10 04:25 PM
Insert a value into formula Ed Excel Discussion (Misc queries) 5 April 16th 06 06:25 AM
How to insert a formula..but... junkmandan Excel Discussion (Misc queries) 6 January 26th 06 08:17 PM
insert formula [email protected] Excel Programming 1 August 16th 05 07:27 PM
insert a new row by formula Doug Excel Worksheet Functions 3 November 18th 04 12:28 PM


All times are GMT +1. The time now is 08:53 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"