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

Hello all,
Another simple question. What I want do here is do this
formula down through column B. B1 would be A1*increase, B2
would be A2*increase, etc.
I know this is simple enough to do in Excel but.... I'm
trying to learn VBA.


dim increase as integer
increase = Range("H1")

For Each c In Sheets("sheet1").Range("A1:A10")

c.Value = Range("B1") * increase
Next c

Which brings me to my second question. Does anyone (or
website) have sample or old SS w/ code that I could have
to see how simple things work. Some code is basic and
repeating (how to hide a row, how to enter a custom
toolbar)and needed to use VB code realistically. I'm
learning but it's taking forever reading help files and
this newsgroup. When I can record a macro and look at it ,
things make more sense so I was hoping.....

THanks in advance for any and all help
jeffP
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default using range in formula

Is this a macro what you would like to do?


Dim increase As Integer
Dim j As Integer

increase = Range("H1")

For j = 1 To 10
Range("B" & j).Value = Range("A" & j).Value * increase
Next


--
Samura


"jeffP" wrote in message
...
Hello all,
Another simple question. What I want do here is do this
formula down through column B. B1 would be A1*increase, B2
would be A2*increase, etc.
I know this is simple enough to do in Excel but.... I'm
trying to learn VBA.


dim increase as integer
increase = Range("H1")

For Each c In Sheets("sheet1").Range("A1:A10")

c.Value = Range("B1") * increase
Next c


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default using range in formula

Try using the Macro Record facility which will give you a good start.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"jeffP" wrote in message
...
Hello all,
Another simple question. What I want do here is do this
formula down through column B. B1 would be A1*increase, B2
would be A2*increase, etc.
I know this is simple enough to do in Excel but.... I'm
trying to learn VBA.


dim increase as integer
increase = Range("H1")

For Each c In Sheets("sheet1").Range("A1:A10")

c.Value = Range("B1") * increase
Next c

Which brings me to my second question. Does anyone (or
website) have sample or old SS w/ code that I could have
to see how simple things work. Some code is basic and
repeating (how to hide a row, how to enter a custom
toolbar)and needed to use VB code realistically. I'm
learning but it's taking forever reading help files and
this newsgroup. When I can record a macro and look at it ,
things make more sense so I was hoping.....

THanks in advance for any and all help
jeffP



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default using range in formula

That was exactly want I needed to know. How to assign a
variable to the row and keep the column the same.
Thank you.
-----Original Message-----
Is this a macro what you would like to do?


Dim increase As Integer
Dim j As Integer

increase = Range("H1")

For j = 1 To 10
Range("B" & j).Value = Range("A" & j).Value * increase
Next


--
Samura


"jeffP" wrote in message
...
Hello all,
Another simple question. What I want do here is do this
formula down through column B. B1 would be A1*increase,

B2
would be A2*increase, etc.
I know this is simple enough to do in Excel but.... I'm
trying to learn VBA.


dim increase as integer
increase = Range("H1")

For Each c In Sheets("sheet1").Range("A1:A10")

c.Value = Range("B1") * increase
Next c


.

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default using range in formula

Bob,
Actually that's exactly what I've been doing, and I am
learning (slowly) but I miss key things like Samura just
showed me . Assigning a variable row # to a static column.
jeffP
-----Original Message-----
Try using the Macro Record facility which will give you a

good start.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"jeffP" wrote in message
...
Hello all,
Another simple question. What I want do here is do this
formula down through column B. B1 would be A1*increase,

B2
would be A2*increase, etc.
I know this is simple enough to do in Excel but.... I'm
trying to learn VBA.


dim increase as integer
increase = Range("H1")

For Each c In Sheets("sheet1").Range("A1:A10")

c.Value = Range("B1") * increase
Next c

Which brings me to my second question. Does anyone (or
website) have sample or old SS w/ code that I could have
to see how simple things work. Some code is basic and
repeating (how to hide a row, how to enter a custom
toolbar)and needed to use VB code realistically. I'm
learning but it's taking forever reading help files and
this newsgroup. When I can record a macro and look at

it ,
things make more sense so I was hoping.....

THanks in advance for any and all help
jeffP



.

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
How do I enter formula sum(range+range)*0.15 sumif(range=3) tkw Excel Discussion (Misc queries) 2 October 1st 09 09:17 PM
conditional formula: sum a range if text present in another range NeedAdvice777 Excel Discussion (Misc queries) 10 August 29th 06 04:51 PM
formula to sort a range so that it matches the exact rows of a column that is outside that range? steveo Excel Discussion (Misc queries) 1 June 18th 06 02:05 AM
Macro to input formula in range based on another range Peter Atherton Excel Programming 0 October 9th 03 12:47 AM
Range.Formula and Range question using Excel Automation [email protected] Excel Programming 0 September 19th 03 04:53 AM


All times are GMT +1. The time now is 02:27 AM.

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"