LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #5   Report Post  
Posted to microsoft.public.excel.misc,microsoft.public.excel.programming
nomail1983
 
Posts: n/a
Default VBA code to populate 1000's of cells?

Thanks so much to all -- JE, Bernard and David and anyone
else that follows.

JE and David (or anyone else), can you comment on VBA Rnd
v. Excel RAND(). Are they the same algorithm? if not, is one
known to be better than the other?

Bernard, your instructions were impeccable. I can correct
the off-by-one error (rowOffset:=10 yields 11 cells, not 10).

How can I make 10 a "variable" -- an input or parameter to
the macro or a reference to a cell value? I can live with
editing the macro for now; or I can use David's idea with
"for each ... in selection". But I thought this should be a
simple embellish to Bernard's macro (famous last words!).

Borrowing FE's formula syntax (thanks very much) and taking
a wild guess (I know: RTFM!), the following did not work.
But it demonstrates what I want to do -- and of course, I am
open to any better ideas.

Dim mysz as long
mysz = "=IF($A$1 0, $A$1, 10)"
Range(ActiveCell, ActiveCell.Offset(rowOffset:=mysz, columnOffset:=0)).Select

I tried various incarnations with ".Formula" and ".Value", even
a hypothetical Value(...) function, to no avail. Obviously I need
to get that book or study one of the tutorial web sites.

In any case, your responses have been a great motivator, and
it gave me a head start. Thanks again.


 
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
Auto populate cells based on 2 cells division. Chance224 Excel Discussion (Misc queries) 0 April 4th 05 09:35 PM
REVISED ?? - populate limited cells w/ set value Jane Excel Worksheet Functions 1 March 19th 05 02:29 PM
How do I select cells and make the info populate into a form? jompeters Excel Worksheet Functions 0 January 7th 05 09:43 PM
Convert data type of cells to Text,Number,Date and Time Kevin Excel Worksheet Functions 1 December 31st 04 12:57 PM
how can i select all the cells with same color on a sheet if there are multipale colors by vba code uobt Charts and Charting in Excel 1 December 15th 04 05:27 PM


All times are GMT +1. The time now is 06:09 AM.

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"