Question
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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started