Question

In VBA Code, I am trying to insert values for an entire column, but I want...

In VBA Code, I am trying to insert values for an entire column, but I want to stop inputting values with the last cell that has a value.

For Each Cell In Range(addedCell.Offset(1, 0), addedCell.Offset.End(xlDown))

Cell = UpdateCells(Cell.Offset(0, -1))
  
Next Cell

The above code populates a value for the entire column but I want the sub to stop at the last cell with a value in the column. How can I code for that?

Homework Answers

Answer #1

Dear,

I may need more information to provide you a simple code for your objective, If you can help me with your scope and what you want to achieve with this code. Still as per the description what I got is, you want to stop loop on any condition, you can try putting an IF within loop.

A detailed clarification or understanding will be help, to complete the code.

For Each Cell In Range(addedCell.Offset(1, 0), addedCell.Offset.End(xlDown))

If Cell <> "" Then

Cell = UpdateCells(Cell.Offset(0, -1))
  
End If

Next Cell

OR


Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
I am trying to take a string of numbers seperated by a single space and covert...
I am trying to take a string of numbers seperated by a single space and covert them into a string array. I have created the following code but it only works if the numbers are seperated a a comma or something similar to that. Example of what I am trying to achieve: string input = "1 1 1 1 1" turn it into.... int[] x = {1,1,1,1} so that it is printed as... [1, 1, 1, 1]    This is...
So, I am trying to perform a goodness of fit test on a set of data....
So, I am trying to perform a goodness of fit test on a set of data. The data consists of one thousand samples with values that range between 3.9 to 15.5. In the problem it is stated that this data could have either a gamma or normal distribution and I am meant to figure out which of these distributions it is closer to due to the results of two goodness of fit tests (one assuming gamma distribution and the other...
I am trying to conduct a statistical test on some values I have (maybe a Z...
I am trying to conduct a statistical test on some values I have (maybe a Z or T test), but am confused on what to do. Is there any test I can do if I know: Test 1: n=43, mean=53.52 s, standard deviation=55.96 Test 2: n=64, mean=52.81 s, standard deviation=47.75 I'm not sure if this is enough info to conduct a test (For reference, this is representing the average time spent at a birdfeeder in two different locations over 5...
I am trying to understand a couple related questions that I missed. I want to understand...
I am trying to understand a couple related questions that I missed. I want to understand the whole picture of it, because I am still struggling with resonance because I am having problems understanding these.   Why is the hydroxyl oxygen atom of the carboxylic acid functional group sp2? What are the hybridizations of the oxygen and nitrogen atoms in 1-(3-methoxyphenyl)-N,N-dimethylamine? (sorry it won't let me copy and paste the structure from chemsketch, I tried) I had put down sp3, sp3,...
I am trying to solve the following C++ problem over structures. I am having trouble with...
I am trying to solve the following C++ problem over structures. I am having trouble with the very last structure and I made a comment next to where I am confused. I included the assignment instructions and my current code. I would appreciate if anyone can help me explain what I need to do for the last structure. Thank you. Assignment Instructions Create a program that will prompt me for each of the following items: 1. Date of Birth 2....
i want to complete this code to insert a new node in the middle of list...
i want to complete this code to insert a new node in the middle of list (take a node data from user, search the node and insert new node after this node). this is the code #include <iostream> #include <stdlib.h> using namespace std ; struct Node{                int data;                Node *link ;}; struct Node *head=NULL, *tail=NULL; /* pointers to Node*/ void InsertFront(); void InsertRear(); void DeleteFront(); void DeleteRear(); int main(){                int choice;                do{                               cout << "1:...
Hello, I am trying to use python to calculate the terminal velocity of an object falling...
Hello, I am trying to use python to calculate the terminal velocity of an object falling from a height of 3 meters. I have gotten stuck trying to actually calculate the terminal velocity. thanks for the help! Here I have posted the code I have so far. from visual import* myscene = display(range = 10, width = 600, heigth = 600, background = color.blue, title = 'lab 5' ) #display window s = vector(0,3,0) #vector for starting position m =...
How do I make this code not include negative numbers in the total or average if...
How do I make this code not include negative numbers in the total or average if they are entered? (C++) For example, if you enter 4, 2, and -2, the average should not factor in the -2 and would be equal to 3. I want the code to factor in positive numbers only. ----- #include using namespace std; int main() {    int x, total = 0, count = 0;       cout << "Type in first value ";   ...
4- a. How many unique Plickers cards are possible (not considering rotation) if you want the...
4- a. How many unique Plickers cards are possible (not considering rotation) if you want the code to be balanced. Which is to say: each value has the same number of 1's and 0's? (Note: the actual Plickers cards values are not balanced.) b. How many more cards are possible if the code includes near balanced values? Which is to say, rather than an equal number of 1's and 0's, from an equal number there is an extra 1 or...
I am trying to figure out how to find the most common word length in the...
I am trying to figure out how to find the most common word length in the british dictionary. I have inputted the text file for the british dictionary into my program. I tried a tedious way, but it doesn't seem effective. Can someone help me? String longestWord = "";        int maxLength =0;        int count1 =0, count2 =0, count3=0, count4=0, count5=0, count6=0, count7=0, count8=0, count9=0, count10=0;        Scanner scanFile = new Scanner (new File("BritishDictionary.txt"));       ...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT