Looping Macro (delete Every Other Line On A Spreadsheet)
Jan 16, 2010
How do I write a macro that will delete every other line on a spreadsheet? I can create a macro that delete one line using the Record a macro command but what do I ad at the end of the macro to keep it going until stopped with Ctrl Break?
View 13 Replies
ADVERTISEMENT
Feb 11, 2013
I have a number of spreadsheets, all of the same format, saved into ("C:Email Attachments").
I wish to populate a master workbook, using a macro to loop through all of the workbooks in that folder, copying all of the data (Starting at B52-Q52) using Selection.End.Down, as the row count is always different and pasting it into the master workbook. Sometimes there may only be one row, so an IF statement may be required, to say if there is nothing in B53 then don't do Selection.End.Down. The overall result would be for all of the data from each spreadsheet is detailed as one big list in the master spreadsheet.
View 4 Replies
View Related
Feb 6, 2014
I manage an monthly inventory spreadsheet with over 100 various items in the master list. However in any single month there may be only 5 or 10 active items that need to be reported on. How do I develop a macro that will check the "items on hand" column and delete the entire row if the quantity is "0". My report is limited to showing only items on hand and not the entire list of items.
View 1 Replies
View Related
Apr 10, 2014
I have a sheet called "Data", which has a list of individuals, and a sheet called "Timetable".
Using input boxes, I get from the user: number of sessions, frequency, session name and then I can get the following sessions to populate:
Date PatientSession Name
09/04/14 xxxx
10/04/14 xxxx
What I am trying to do is populate the "patient" column with the name from the "data" sheet, and then loop for all names, ie, ending up with
Date PatientSession Name
09/04/14 AA xxxx
10/04/14 AA xxxx
09/04/14 AB xxxx
10/04/14 AB xxxx
I have attached a sample of the sheet
View 5 Replies
View Related
Apr 24, 2014
I'm trying to create a macro that will look at each worksheet in a workbook and then delete the last line of data on each worksheet. The last row can vary on each worksheet. This is what I have come up with but it is not working. I am on Excel 2010 and Windows 7.
Sub Macro1()
Macro1 Macro
Dim ws As Worksheet
[Code]....
View 2 Replies
View Related
Apr 23, 2013
A1:A10 contains numbert 1 - 10 (A1 = 1, A2 =2 etc.)
B1:B10 contians letter A - J ( B1= A, B2 = B, B3 = C etc.)
Condition: If the Value of cells in Column A is greater than 1 Then read the adjacent cell's value into an array (eg. MyArray)
I was able to use Dictionary object to read everything and then dump into an temp array
Is it possible to populate the temp array values into spread sheet wiout looping through each item?
The following code simply populate the first item in the temp array into each cell in the the destination
Code:
Sub MyArray_Test()
Dim MyArray As Variant
Dim i As Long
[Code].....
View 2 Replies
View Related
Jun 9, 2009
a macro that will delete a line if the message #N/A appears. Right now I have a macro that will hide a row if it has a zero in it and it loops all the way till it hits "done" would like to add the ability to delete a row with #N/A in it, here is my code for the hide zero macro
View 9 Replies
View Related
Jan 5, 2010
The code should go through each worksheet and if the row in column A has a null value or 0, then delete the row. The count is based off of column T. The row deletion portion of the code works, but something is wrong with my worksheet looping structure.
View 5 Replies
View Related
Apr 30, 2013
I have a worksheet that I need to be able to easily copy and paste the formula/formatting from the row above, but not the Values entered, (if any). I am using columns A to DG.
I just really need to be able to copy all the formula in these cells down - nothing exciting or fancy.
I've tried formatting as a table as per some searches and that was difficult! My column headings changed, and when I inserted a row, two of the formula's wouldn't copy down - plus the shading and borders went wonky in places.
View 2 Replies
View Related
Dec 8, 2007
i hv following code
(i use generate macro)
my question is how to arrange the code from one line to multiple like :-
following code show in excel macro environment is one striaght line.
' Create new var on yr , and replace 2006 to CY06.
ActiveCell.FormulaR1C1 = _
View 9 Replies
View Related
Dec 31, 2008
if it's possible to have a red line going across the spreadsheet while using the arrow keys it follows you down through all cells. And is there a vba coding that someone has ready written.
View 9 Replies
View Related
Jan 20, 2013
How would you set up a macro to delete numbers in a spreadsheet in one column that appear in another column or worksheet?
In other words, if I have the numbers 1,2,3,4,5,6,7,8,9, 10 in one column and in the same column, or another column or worksheet I have the numbers 1,2,3,4,5 - I need a way to delete 1,2,3,4,5. I know how to delete duplicates via the advanced filter but I want to have the duplicate and original deleted.
View 3 Replies
View Related
Apr 8, 2008
I have a spreadsheet where there is a white line that is over a row line. No matter what I do I cannot seem to delete it.
I zoom in but I cannot select it.
I change the border of the cells and it will not disappear.
I am completely lost as to what else it could be, no doubt it is a simple answer that is staring me in the face. I inherited the spreadsheet so not sure what was done in the past.
View 9 Replies
View Related
Dec 1, 2011
Is there anyway this can be done using a button in the spreadsheet?
For Example.
I send numerous almost identical forms to a colleague and to eliminate subject line typo's (Reference numbers) i would like the Subject line to match a cell in the document itself.
I have experience in working with Excel, but none on using code/macros
View 2 Replies
View Related
Jan 23, 2009
Need to delete the line on this worksheet and post how they did it.
View 2 Replies
View Related
Jan 13, 2010
I have 2 columns in Excel wich havn't the same amount of lines.
One colom is 65.000 lines and the other one is 64.000
I am looking for a option to delete 1 line after each 65 lines.
Is this possible?
View 6 Replies
View Related
Jun 12, 2008
How would you make a macro that would delete the line if a field in that line say for example K1:K100 had "XX" or "XXX" in it?
View 10 Replies
View Related
Mar 4, 2013
I have seen so many examples online but none of them give the way to look for a value that I will input on a pop box.
In other words the macro will ask user for what value to look for. Once input then macro will run and delete row if value found if value is not found then return error and stop macro.
View 9 Replies
View Related
Mar 7, 2014
I have this Command button that switches on and draws a line. If you press it again then I need to delete that line.
If I push the button multiple times Excel keeps changing the name of the line. I have multiple lines on the same worksheet and text boxes but only this 1 line needs to be delete. I would think that theres a way to assign a permanent name to this line and delete and recreate it but...
ActiveSheet.Shapes.AddConnector(msoConnectorStraight, 319.5, 77.25, 319.5, _
245.25).Select
With Selection.ShapeRange.Line
.Visible = msoTrue
.Weight = 1.25
[Code]....
View 3 Replies
View Related
Sep 9, 2013
For example, on cell A1 I have 123456 Total, how do I delete the word "Total"? I have abut 2000 lines. What formula do I use?
View 5 Replies
View Related
Nov 20, 2008
Let's say I have the following file which is imported via a macro which comes from a txt file. [Apologies it's 7mb zip file] http://www.fileden.com/files/2007/8/...mpNotFixed.zip
The way the txt file is that two rows make up one row, but SAP spits the data out into two rows. Now there are specific things that I need from these tabs. The way i can get this data is to perform sort by descending on the tabs. When you sort by a descending you get the data that i need [at the second half of the worksheet]:
Basically what I want to know when i create a macro, how can i get it do delete all the rows above a specific row. In the attached file, go to DataImport2.
I would like a macro to find the word "English" in column C and then delete all the row's above it. I cannot record this because it copy's the specific cells, which i do not need. DataImport3 is how the data comes out, All i do is sort by descending ... and i need help as stated above to delete all unnecessary data.
View 3 Replies
View Related
Jun 19, 2007
I use the Append command to write a line to a text file. I have about 3 excel files appending data to the same text file.
If someone were to write a line in error I would like to have the ability to delete it.
View 3 Replies
View Related
Jan 29, 2014
I have a text document with 1000 lines. All the lines are in this format
important< %#$ other words
other important thing < %Z$different words
some important text < $# some other words
I want to know if is such a excel filter that will delete all the characters starting from "<" until the end of the line.
So, the output of this 1000 lines will look something like this:
important
other important thing
some important text
View 4 Replies
View Related
Dec 10, 2013
On this chart, I don't want to display the steep line segment between the first and second datapoints. I only want to display the datapoints. I also want to not display the segment of the label associated with this segment.
View 3 Replies
View Related
Nov 2, 2009
Aloop I am trying to put into a macro. I have a variable range of data in Column C, header is in C1. I need to split the data in each row of the array using this code.
View 2 Replies
View Related
Jun 17, 2008
I have a macro (written with the help of forumites here) which, when selecting a cell on a particular sheet, will select and copy data from various rows on various sheets, print a resulting chart, before returning to the original sheet.
Now, I use autofilter on the original sheet to help organise the data I wish to copy and print.
My question: is it possible to adapt my macro so that, once it has run through once, will move to the next cell in the autofiltered column and run the macro again, and again, and again... to the bottom of the autofiltered column?
At the moment, I'm running the macro, pressing the 'down' key and then running the macro again until I've exhausted the column. There must be an easier/better way.
View 9 Replies
View Related
Sep 25, 2008
The below code outputs a value in the cell corresponding to alpha by drawing information from the range in issueRng. However it will only grab the value from the first cell in the range of issueRng. It grabs this cell value and outputs it in every cell corresponding to alpha. For instance if i have issueRng as the range from C6 to E6 (3 cells), then the code draws the value of C6 and puts it in the cell corresponding to alpha which for the first loop is Cell(7,6). However the code is putting the value from C6 into every cell instead of moving through the range of issueRng.
Dim alpha As Double
alpha = 6
Dim issueRng As Range
Set wb = ActiveWorkbook
With wb.Sheets("Issues")
Set issueRng = Sheets("Issues").Range(.Range("C6"), .Range("C6").End(xlToRight))
End With
For Each CELL In issueRng...............
View 9 Replies
View Related
Aug 20, 2009
I am a bit stuck in looping my macro. I have a working macro that does various functions for a period (say January) and I wish to run for periods 1 to 12. The cell "A1" has a drop down list (jan09, feb09 to Dec09).
Currently I select the month from Cell A1 and run the macro. Now wish to loop this macro so it runs from Jan09 to Dec09 in one go. The cell A1 is being refererence in the Vlookup table that changes ranges in a table that are been used as dynamic ranges in a macro.
Simplied Macro Steps
1. Select month in cell A1 (sheetX), then Calculate.
2.This refeshes lookup table and runs the macro say copies cells (B10:D100) in sheetBud and pastes in sheetTest A10. Insert rows A10:A100. Ends
Currently I manually changes the step 1 and then run this macro for next month. But now wish to run it for 1 to 12 months in one go. Please please can you can help me with the Looping. Please note that the macro does other functions and the steps above are simplied.
View 9 Replies
View Related
May 15, 2014
I have 2 lists of codes with values tied to them, columns A & B, and columns C & D. Column A is a list of the codes in use, and column C is every code possible, I need to line up the codes and shorten column C to match column A, while retaining the value that is tied to each code so that I can compare Columns B & D easily.
View 2 Replies
View Related
Oct 23, 2008
What I'm trying to do: While there's a value in Col A starting with A2, I need to then go to the corresponding cell in Column O, starting with O2. Then as long as there's text in the next cell in the same row keep track of those cells so that in the end I can append all text in the adjacent cells to the text in the Col O[X] cell. Then repeat as long as there's text in the next row cell of Col A. I have the routine to append the text, I just need help with the looping.
IE:
If I start with the following:
Col A Col O Col P Col Q
row 1 ----- ----- ----- -----
row 2 1 Text here new text
row 3 2 More text more text 2 more text 3
row 4 (no text in any of this row.......................................)
After running macro this would become
Col A Col O Col P Col Q
row 1 ----- ----- ----- -----
row 2 1 Text here..............................
View 5 Replies
View Related