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 add an item, insert and sort to a list without using built...
I am trying to add an item, insert and sort to a list without using built in functions such as .append or insert or extend I have to write def function. I want to add maria to the student name list. and write another def function to sort it using index. studentname=["kay","joe"] def addname(studentname): newlist = studentname[0] for i in range(name): name=input("enter name") newlist =studentname +[name] print(studentname) addname(newlist)
I am trying to print an essay in my python code but the words keep getting...
I am trying to print an essay in my python code but the words keep getting cut over two lines. How can i fix this using python code so that it is formatted nicely? thanks
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...
This is a code. In words how can I describe this? This is the code. Private...
This is a code. In words how can I describe this? This is the code. Private Sub btnDisplay_Click(...) Handles btnDisplay.Click Dim word As String = "courage" Dim letter As String = "" Dim numVowels As Integer = 0 For i As Integer = 0 To (word.Length − 1) letter = word.Substring(i, 1) If IsVowel(letter) Then numVowels += 1 End If Next txtBox.Text = CStr(numVowels) End Sub Function IsVowel(letter As String) As Boolean letter = letter.ToUpper If (letter = "A") Or...
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 am having issues with a Backus Naur assignment I want to define rules that allow...
I am having issues with a Backus Naur assignment I want to define rules that allow for an integer named x to have one of the following: 0-F followed by “h” to define a hex value, 0-1 to define a binary value, or 0-9 followed by a “d” to define a decimal value. For example, int x = 3d would be a legal statement On the other hand, int x= 4b would not be legal (binary numbers can only be...
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:...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT