Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I'm trying to create a macro for vba that grabs values entered in my A column of cells 1-1000, and then takes those values and

I'm trying to create a macro for vba that grabs values entered in my A column of cells 1-1000, and then takes those values and plugs them into an function.

Rather than define a 1000 differnt values as:

x1 = Worksheets("Sheet1").Range("A1").Value

x2 = Worksheets("Sheet1").Range("A2").Value

x3 = Worksheets("Sheet1").Range("A3").Value

... etc

and then plugging them into my function (note this isn't my actual function but its just an example)

fx= x1+x2+x3....

is there someway I can create a do loop that runs from cell A1 to A1000 grabbing each of their own values and plugging it into my function? Here's what I have so far but I'm not sure how I would have it grab the values entered in the cells.

xi = 1 Do xi = 1 + xi If xi = 1000 Then Exit Do Count = Count + 1

Loop

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Advances In Spatial And Temporal Databases 11th International Symposium Sstd 2009 Aalborg Denmark July 8 10 2009 Proceedings Lncs 5644

Authors: Nikos Mamoulis ,Thomas Seidl ,Kristian Torp ,Ira Assent

2009th Edition

3642029817, 978-3642029813

More Books

Students also viewed these Databases questions