Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Enter simulation-related HLOOKUP formula in cells


Thank you very much Tom, this does the trick alright. :)


Tom Ogilvy Wrote:


sStr = Range("A2").Value
Range("B2").formula = "= HLOOKUP( RAND(), SLT_" & sStr & ", 2)"

--
Regards,
Tom Ogilvy



"Alex Hatzisavas" wrot
in
message ...

Cheers to all!

I kindly request your help on the following task, as I cannot see

to
get this going myself:

In Column B, say cell B2, I need to enter the following formul

using
VBA:

= HLOOKUP ( RAND(), << RANGE NAME DEPENDENT ON VALUE OF CELL A2

2
)

The RANGE NAME required above has already been defined with VBA code
somewhere else in the Workbook.

If Cell A2 is, for example, M10, the RANGE NAME required above has
already been defined as: SLT_M10

Thus, what I need to implement in VBA is to enter in cell B2 the
following formula:

= HLOOKUP ( RAND(), SLT_XXX, 2 ),

where XXX stands for the value of the cell A2 (say M10).

Hence, if entered correctly into cell B2, the formula would finally
be:

= HLOOKUP ( RAND(), SLT_M10, 2) , where M10 is the value of cell
A2.

(The RANGE NAME SLT_M10 has already been defined with VBA code
somewhere else in the Workbook).

I do not want to do this manually (i.e. simply type the damned
formula), since Column A (and hence, Column B) will have around 4000
rows (=4000 formulas in Column B).

I'd be very grateful to read your views on the issue, either on this
forum or at my personal e-mail:

Kind regards,
Alex


--
Alex Hatzisavas


------------------------------------------------------------------------
Alex Hatzisavas's Profile:

http://www.excelforum.com/member.php...o&userid=14559
View this thread

http://www.excelforum.com/showthread...hreadid=261928


--
Alex Hatzisava
-----------------------------------------------------------------------
Alex Hatzisavas's Profile: http://www.excelforum.com/member.php...fo&userid=1455
View this thread: http://www.excelforum.com/showthread.php?threadid=26192

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
Enter formula that uses values from other cells charliedog Excel Worksheet Functions 11 October 23rd 08 06:21 PM
excel simulation formula larry Excel Worksheet Functions 1 October 1st 08 05:06 PM
enter consecutive cells into a formula Gil Excel Discussion (Misc queries) 2 September 19th 06 08:46 PM
ENTER DATA EXCELL SO RELATED DATA APPEARS VICKIO66 Excel Worksheet Functions 2 August 23rd 05 01:16 AM
Enter simulation-related HLOOKUP formula in cells Alex Hatzisavas Excel Programming 1 September 21st 04 02:02 PM


All times are GMT +1. The time now is 06:04 PM.

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"