Move Every Other Cell In A Column To Row Above It Then Delete Previous Row
Jul 11, 2014
I have a spreadsheet that I need to rearrange to improve readability. I have an example attache, which is easier to understand than describing it, but I'll try:
I want to start in a1, move to a2
copy a2 to b1
delete line 2 (the previous lrow 3 now becomes row 2
if a2 > 0.01, skip it and
move & select cell a3
... and repeat the above logic, on the next series of cells...
E.g.
copy a3 to b2
delete line 3 (the previous lrow 4 now becomes row 3
if a3 > 0.01, skip it and
move & select cell a4
...and repeat the sequence again.
View 2 Replies
ADVERTISEMENT
May 29, 2014
I have set of data Pasted in 4th row, in the top row 44 columns values assigned i want move data from set of data to different column among these 44 columns
Like "Service Order ID" is 1 column in set of data ,it move to second column of top row
Some of column need to delete. (Service Order Type,Service Order Description,Created By,Status,Contact,Expected Delivery Date,
Creation Date,Priority,Net Value,Currency,External Reference,Reference Date)
I want Get output result in same sheet (Actual).
View 3 Replies
View Related
Jul 23, 2007
We have a client that provided us with a text file that we imported into
Excel. Rather than have the entire record in one row, they have the record
in 4 rows.
What I need a macro or something to do is move award 2 award 3 and award 4 into the same row and after doing this delete the other rows.
Below is an idea how this looks.
1JohnSmithstreetcitystateZIPaward 1
2JohnSmithstreetcitystateZIPaward 2
3JohnSmithstreetcitystateZIPaward 3
4JohnSmithstreetcitystateZIPaward 4
5BillJonesstreet2city2state2ZIP2award 1
6BillJonesstreet2city2state2ZIP2award 2
7BillJonesstreet2city2state2ZIP2award 3
8BillJonesstreet2city2state2ZIP2award 4
What we need for our data to work is:
1JohnSmithstreetcitystateZIPaward 1award 2award 3award 4
2BillJonesstreet2city2state2ZIP2award 1award 2award 3award 4
View 9 Replies
View Related
Apr 16, 2013
I want to move to the next row but i don't want to make another format just when i begin to write in the next row the format appear automatically like previous row ?
Note : format include formulas ,borders and colors every thing in previous row ...
View 10 Replies
View Related
Jan 30, 2007
=IF(AND(EOMONTH(TODAY(),COLUMN()-2)<TODAY(),(TODAY()<EOMONTH(TODAY(),COLUMN()-1))),Sheet2!C10,"NO VALUE")
The above formual resides in each cell in row 1 column g inclusive.
The question is when I move over columns the previous column with figure is wiped out because false "no value" becomes true.
How do I stop the previous data from being wiped out once I move on in columns?
View 14 Replies
View Related
Sep 19, 2012
i have code like this to copy certain word in cell and place it at new sheet:
VB:
Sub Foo()Dim i As Long, iMatches As Long
Dim aTokens() As String: aTokens = Split("Accommodation", ",")
For Each cell In Sheets("Sheet1").Range("C:C")
[Code].....
the problem is the cell source is not deleted. what line should i change in code above to move the result to new sheet and delete row source
View 7 Replies
View Related
Jun 21, 2009
I have a spreadsheet (Sheet 1) listing current Work Orders with each work order occuping a seperate row; Column E lists the status of the work order, with the status being chosen from a drop down list.
I would like to have a macro that will copy the entire row and paste into (Sheet 2) when the status is changed to CLOSED, and clear the contents of the cells on Sheet 1.
The aim of this being of course to have all open work orders on sheet 1 and all closed orders on sheet 2.
View 9 Replies
View Related
May 23, 2006
I have a spreadsheet with a serial number is row 1 in column A with the rest of Row 1 empty. Column A is empty in Row 2, but has the data associated with the row above in columns B through L of Row 2. Then comes 2 blank rows and the pattern repeats with a new serial number in column A of row 5 and so on. I would like to move the serial number down one row, delete the now empty first row, delete the following 2 empty rows, and then loop to do the same thing again for all 9000 rows of the spreadsheet.
View 2 Replies
View Related
Apr 4, 2014
I found some VBA code that saves the previous value entered into a cell and displays it as a comment. I've attached that workbook as an example, but I want to change 3 things.
1) I only want to capture the previous values from Sheet1.Column1 (you'll see the example captures changes on the whole sheet1).
2) I want to 'paste' the previous value of Sheet1.Column1 in the corresponding row of Sheet1.ColumnD (i.e. the previous value of A5 will be displayed in D5). The code currently pastes the value in the corresponding address in sheet2.
3) I do not need the comments part. Simply displaying the previous value in the corresponding row of Sheet1.ColumnD is good enough.
View 2 Replies
View Related
Feb 28, 2014
I have found this code by searching witch is perfect
Code:
If Target.Cells.Count > 1 Then Exit Sub
Application.ScreenUpdating = False
Cells.Interior.ColorIndex = 0
With Target 'With the cell that was selected,
.EntireRow.Interior.ColorIndex = 8
.EntireColumn.Interior.ColorIndex = 8
End With
Application.ScreenUpdating = True
The point is that i want to retain the previous formatting of cells when i select another cell. And also i would like to create a switch to turn the Worksheet_SelectionChange event on and off. The tricky part is here i guess, becouse i would like when turned off to retain the previous formatting also.
View 2 Replies
View Related
Feb 15, 2009
OK essentially this is my problem:
I have a daily spreadsheet, uou update for inputs and outputs each day and the spreadsheet gets to an overperformance figure (sorry if the spreadsheet is a lottle unclear, it is a simplified version)
On the first day of each month, the opening target is adjusted and you start again. The probelm is you dont know what the opening target is until roughly 21st of the month.
I created a macro that deletes the opening target and removes all the previous days before the start of the month.
The way i done this was:
Create a copy of "daily" tab, change b5 to equals c2 and copy and paste special as values. Then in d5-d58 and f5 - f58, vlookup values from old "daily" tab , and then copy and paste special as values. Then delete old "daily" tab and remname daily(2) as "daily"
What i have done is essentially created a new tab on 21st March, looking back to data only as far back as 1st Mar and the new opening bal and target is found. The macro can be used on the 21st of each month.
but...macro doesnt work, i have tried a few times and i think it is because i am vlookuping up data from a tab that i later delete...please help!! - thanks a mil to anybody that can give me a steer in the right direction.
View 14 Replies
View Related
Jan 27, 2010
I would like to create some VBA that looks for sub's or modules and delete them.
View 9 Replies
View Related
Jun 23, 2007
I need a macro to loop through a column and delete any date prior to todays date, as well as all cells in the deleted date's row.
View 2 Replies
View Related
Jun 1, 2014
i need a code that moves down a column and for every empty cell in the column the cell to the left is cleared and then it moves on to the next cell down. the column is not always the same and will start from a selected cell, and the column will contain no more than 5 rows
View 3 Replies
View Related
Aug 21, 2007
I want to enter a number 0 to 999 in cell A1 and when the enter key is pressed move the contents of cell A1 to A2 and A2 to A3, cascading down until A40. So after five numbers the first number I entered woul now have cascaded down to cell A5 ready to go into cell A6.
Would I have to use some kind of program or does excel have a command for this?
View 11 Replies
View Related
Jun 18, 2009
As I move down a cell, I would like the entire row and column be highlighted. Is that possible?
View 11 Replies
View Related
Mar 14, 2014
Basically I have an export which I need to manipulate so I can do a mail merge. I've managed to find a solution to remove the data I don't need and also managed to create the mail merge (even fixing the weird American date issue)
The data that is left looks a bit like this
Staff ID
Name
week ending
week ending
1
Bob Smith
02/03/14
[Code]...
basically what i need the macro to do is to see theres two Bob Smiths (or 2 Staff Id's "1") and put the second instance in column 4
e.g.
Staff ID
Name
week ending
week ending
1
Bob Smith
02/03/14
09/03/14
[Code]...
in some instances there could be 20+ week ending dates to go into the row.
also I don't need to have the dates all in seperate boxes, I just need the information in a row so the mail merge reads and sends out one message rather than 20 messages to the same person asking for each week by itself.
I've manually moved the dates into the boxes up to now and everything else is working
View 5 Replies
View Related
Feb 8, 2009
I will be moving to a specific cell - "N1". I'm looking for code that will then scan down from that cell, making the first blank cell the active one.
View 4 Replies
View Related
Sep 30, 2010
In columnA I want to jump to the next blank cell in a list that continues to grow. So the first time I run the macro I want to go (blank) cell A5 to paste in some data. The next time I run it, it would need to go to cell A6 and so on.
When I do this manually, I simply hit ctrl down-arrow (takes me to the last cell w/data) and then one more down-arrow to take me to the empty cell below.
When I do this in the macro it seems to remeber the cell as an absolute reference (if that's the term) and so it just copies info in the same location as previous, instead of the next empty cell.
View 5 Replies
View Related
Jul 2, 2014
So I have a few hundred spreadsheets with the following structure:
Persson L. S skogsarb Granberg Malung
Persson M R fru
Persson N skogv Sjog 23 Torsby
What I want to do is move/split the ultimate word in every cell in column A to a parallel cell in column B, and then delete the word from column A.
View 9 Replies
View Related
Nov 4, 2006
I have sheet1 with four columns. Team, Issue, Discussion and Recommendation. Discussion and Recommendation headings were placed in column B along with the data in the file I was sent. I need to get it back into table format to eventually load into Access. What I'm trying to do is to loop reading down column B. When I find the word “Discussion” (exact format) I need to drop down one row below the word, cut whatever is in the row, move one column to the right, Column C, and two rows up and paste. For example, cell B3 has “Discussion”. I need to drop to B4, cut whatever is in the cell and move to C2 and paste. I also need the same to happen for Recommendation. Find the word, drop down one row, cut whatever is in the cell, move two columns to the right and up four rows. I would like to delete the rows I moved data from, but will do that by hand if it’s too hard to do in a macro.
An example of my data:
TeamText
Design4. Reuse existing code to extent possible.
DesignDiscussion
DesignNo discussion
DesignRecommendation
DesignEstablish a baseline and work to the plan.
Design5. Delete old code
DesignDiscussion
DesignNo discussion
DesignRecommendation
DesignNo recommendation
Design6. Plan to work without full details.
DesignDiscussion
DesignIncremental design
DesignRecommendation
DesignWork on smaller details first
Sub Discussion()..................
View 3 Replies
View Related
Aug 9, 2007
I need to create a repeatable macro/module to help me prepare a spreadsheet for import into Microsoft Access. In each row of the spreadsheet is various information including Order Number, Model, and Serial Number. The problem lies in the Serial Number column, which often contains several Serial Numbers delimited by commas. In order to serve my needs in Access, each Serial Number instance needs to become a new row ( record) wherein all of the information (except for the Serial Number) is the same. It is crucially important that all of the serial numbers are in the same column. (I tried using text to columns as a starting-off point, but seemed to dead end).
Example:
Order#1; Model1; Serial1, Serial2, Serial3
Needs to become:
Order#1; Model1; Serial1
Order#1; Model1; Serial2
Order#1; Model1; Serial3
View 9 Replies
View Related
Nov 7, 2009
I am running Win XP and Excel 2003.
I have a macro I found here on the boards written by Lenze to delete an entire row based on what is found in column A. I would like to delete any row where Col. B contains 10 or less characters and I have modified it to do so (or at least I think it does). My problem is that it takes about 12 minutes to run the macro (I have about 50k lines to run through). I was wondering if this is the fastest method or if it examines things other than just column B.
Sub Test()
Dim i As Long
LR = Cells(Rows.Count, "B").End(xlUp).Row
For i = LR To 2 Step -1
If Len(Cells(i, "B")) < 11 Then Cells(i, "B").EntireRow.Delete
Next i
End Sub
After this runs, I am left with Columns A to somewhere around AH. The columns are generally in the format of text followed by a numeric column. An individual text column has the same name through all of the rows. The numeric columns have varied values whether negative or positive.
Ideally what I would like: If a given cell (ie. C2) in Row 2 is numeric, then copy the cell to the left (ie. B2) into (ie. C1) and then delete Column B. I need this to work for multiple columns from B to C, skip D and E, and then from F to AG (and maybe beyond).
View 9 Replies
View Related
Aug 20, 2014
I have a spreadsheet which is updated daily. Row A of the sheet has the date in it, and every day a new column is created for the that set of data. I have the below code which works at the moment:
[Code] .....
I want to use this same code on another spreadsheet to do the same process (I need to copy and paste 4 columns (A,B,C + D, into E, F, G & H, then tomorrow it will copy E, F, G & H into I, J, K &L etc etc)). The problem I'm having is that A1:C1 is a merged cell, then D isn't (used as a border to separate). So when it is copied I need to select the merged cell columns and column D (i.e. A:C & D on day 1) and paste it into E:H with E1:G1 merged.
View 5 Replies
View Related
May 18, 2007
Is there a function to put in a new column to get the abbreviated year and month of a previous column in the same row???
Ex. Row A B C D
3/14/2007 5/16/2007 2007-3 2007-5
Instead of using the YEAR MONTH funcion for each row is there a universal function that I could designate to the whole column of C and D something like C=YEAR(A(row#))???
View 3 Replies
View Related
Nov 23, 2012
I am after a macro to insert a column lets say between column A and B. Once column inserted new column B should be filled by a text say "January" but it should be only filled upto the data of column A so if column A has data upto A600 then column B should be filled from B1 to B600.
I tried recording but it fills data upto B65000+.
View 2 Replies
View Related
Jun 30, 2014
I have a excelsheet that looks like this:
Column A | Column B | Column C
Los Angeles | Fire Dept | 3
Los Angeles | Health Services | 12
New York | Fire Dept | 8
New York | Health Services | 22
New York | Internal Services | 100
New York | Public Works | 7
Chicago | Health Services | 15
Chicago | Public Works | 56
Chicago | Social Services | 4
And I am trying to make it look like this:
Fire Dept
Health Services
Internal Services
Public Works
Social Services
Los Angeles
3
12
New York
8
22
100
7
Chicago
15
56
4
View 8 Replies
View Related
Jan 10, 2007
I have a sheet that holds my inventory and has 3 colums. The colums are serialnumber, techid and date. I also have a sheet for each techid. Is there a way to delete/move a row of data if the serialnumber is entered on another sheet.
example.
I have a serialnumber added to my first sheet. I go to a techid sheet and enter that same serial number. Is there a way to copy the entire row the same serialnumber is on and copy to the current sheet? Possibly a search function where I enter a serialnumber and it finds the same thing on the main sheet and copies the rows into the current sheet.
View 9 Replies
View Related
Sep 21, 2009
I am trying to create a macro the looks at column A and moves the entire row to another worksheet or deletes the entire row based off of the value in each cell. Right now I have the Macro replace the downloaded values to either AG, G, GI, ICP, IMG or delete. The idea be to move all of the values with AG in column A to the AG worksheet, move G to the G worksheet, etc.. and then delete all of those with delete in the cell.
View 14 Replies
View Related
Apr 22, 2006
I've included bits of my code and some debug output. Whenever I attempt to add a worksheet, either BEFORE or AFTER I get the following ERROR MESSAGE: Method 'Add' of object 'Sheets' Failed. if I use the .add without before and after a worksheet is added. The problem is that it is always added before the active sheet. I need to replace a single sheet in the correct position of possible 10 sheets. I know the names of the sheets and which one I want to replace, but I can't get EXCEL to move sheets, add sheets by position Number or name, without getting the ERROR.
Public xlApp As Excel.Application
Public xlBook As Excel.Workbook
Public xlSheet As Excel.Worksheet
Public xlRange As Excel.Range
.....
Set xlApp = CreateObject("Excel.Application")
Set xlBook = xlApp.Workbooks.Add
....
xlBook.Worksheets.Add After:="Accounts Receivable" *****
?xlsheet.Name
Accounts Receivable
?xlbook.Worksheets.Count
4
?xlbook.Worksheets(4).name
Accounts Receivable
View 2 Replies
View Related