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

I have 4 cells: H8 I8 J8 K8
If change H8, I8 J8 K8 cells have variable value.
I want to change values of H8 from 10 to 150 and collect all 4 cells value
in columns AF AG AH AI.

Please help me with same VBA code. Thanks.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 131
Default Collect value

Since you didn't specify where to put the collected values, this will drop
them into range A1:D141. Of course you'll want to modify to put them where
you really want them:

Sub myCalcsCollector()

Dim myNum as long

For myNum = 10 to 150
Range("H8") = myNum
application.calculate
cells(myNum - 7, 1) = myNum
cells(myNum - 7, 2) = range("I8")
cells(myNum - 7, 3) = range("J8")
cells(myNum - 7, 4) = range("K8")
Next myNum

If automatic calculation is turned on, then of course you don't need the
line to force calculation.

"cferoiu" wrote:

I have 4 cells: H8 I8 J8 K8
If change H8, I8 J8 K8 cells have variable value.
I want to change values of H8 from 10 to 150 and collect all 4 cells value
in columns AF AG AH AI.

Please help me with same VBA code. Thanks.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 131
Default Collect value

Oh, sorry, you did say the columns you wanted to put them in. Below is the
same thing, but assumes starting at row 8.

"B Lynn B" wrote:

Since you didn't specify where to put the collected values, this will drop
them into range A1:D141. Of course you'll want to modify to put them where
you really want them:

Sub myCalcsCollector()

Dim myNum as long

For myNum = 10 to 150
Range("H8") = myNum
application.calculate
cells(myNum, 32) = myNum
cells(myNum, 33) = range("I8")
cells(myNum, 34) = range("J8")
cells(myNum, 35) = range("K8")
Next myNum

If automatic calculation is turned on, then of course you don't need the
line to force calculation.

"cferoiu" wrote:

I have 4 cells: H8 I8 J8 K8
If change H8, I8 J8 K8 cells have variable value.
I want to change values of H8 from 10 to 150 and collect all 4 cells value
in columns AF AG AH AI.

Please help me with same VBA code. Thanks.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,346
Default Collect value

Hi,

What exactly do you mean by "collect all 4 cell values"?
Where in columns AF:AI do you want to put them? (What row?)
What do you mean by change values of H8 from 10 to 150? H8 is only one cell?

Let's suppose you mean you want to copy the entries in H8:K8 to AF8:AI8 then
this code will do it:

[AF8:AI8] = [H8:K8].Value


--
If this helps, please click the Yes button.

Cheers,
Shane Devenshire


"cferoiu" wrote:

I have 4 cells: H8 I8 J8 K8
If change H8, I8 J8 K8 cells have variable value.
I want to change values of H8 from 10 to 150 and collect all 4 cells value
in columns AF AG AH AI.

Please help me with same VBA code. Thanks.

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
A little VBA help please: collect row value not column Preschool Mike Excel Worksheet Functions 5 September 9th 09 03:30 PM
Collect Modules into one workbook Pops Jackson Excel Programming 2 December 16th 08 02:30 AM
How to collect data from every 60th row? Jim Ryan Excel Discussion (Misc queries) 2 April 4th 06 05:28 AM
Collect numbers.... Zadig Galbaras Excel Discussion (Misc queries) 5 September 25th 05 02:20 AM
collect data from some files Newbie80 Excel Programming 4 August 5th 05 02:56 PM


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