I have this code that removes a group of cells on any row that contains "Y" in Column L, but it does not move the remaining group of cells on a row up after the cells are deleted.
VB code so that when a range of cells are deleted, the row(s) below are moved up?
LastRow = Cells(Rows.Count, "H").End(xlUp).Row 'change "H" to the column that determines which is the last row
For x = LastRow To 4 Step -1 'assuming it starts from row 4
If Cells(x, "L") = "Y" Then
Range("H" & x & ":K" & x).ClearContents ' or use Delete
enables the user to select a row to delete. However, I need to do more than that. I need to be able to copy all the rows until row 37 and move it one row up after the selected row is deleted. Below is the code
We have created a macro that basically looks for rows that contain an "H" and hides the row if it does.
Users can add new rows throughtout the year to this spreadsheet. and based on certain criteria, an H or U will be placed in a hidden column which the macro looks at and hides any row it finds an H.
The user has to click on the button that has the macro assigned to it once they have finished working on the spreadsheet.
The problem we're finding is that for users who insert/delete rows, once they click the button it takes up to 15 seconds to run through macro (which is ok). However, users who haven't added or deleted any rows and who click the button, they have to wait upto 5 minutes (which isn't ok) for the macro ro run.
We can't figure out why the macro takes longer to run when no changes have been made?
I have a workbook with 20+ sheets in it, I add sheets and delete sheets on a daily basis, except for one sheet that is like my summary sheet.
Is there a code, formula, or magic spell that will list the names of the sheets that I have deleted? For instance, if my workbook has 50 sheets and I delete 49 of them, I want to see cells A1 thru A49 (or where ever I wish to place them) filled with the names of the sheets I just deleted.
I used the code below for Conditional Formatting. This works fine but the VBA-code crashes when I delete more than one selected cell. Is there a simple modification possible to prevent this from happening?
Private Sub Worksheet_Change(ByVal Target As Range) Dim icolor As Integer If Not Intersect(Target, Range("A1:C250")) Is Nothing Then Select Case Target Case 1 icolor = 6 Case 2 icolor = 12 Case 3 icolor = 7 Case 4 icolor = 53 Case 5 icolor = 15 Case 6 icolor = 42 Case Else 'Whatever End Select
Target.Interior.ColorIndex = icolor End If End Sub
I copied the sheet and redid the format. I renamed the original dashboard sheet from count to "keep" and named the copy after the original "count" Everything still works great - until i either hide or delete the original count which is now named "keep". I get an error at the red colored line below ".publish false".
All detail data begins in Row 6 in the detail spreadsheet.
In the Summary spreadsheet, it appears to make a difference where my calcs are located in order for my COUNTIF's to work correctly. As long as I keep my summary calc (to total the number of work orders in the detail) in Row 2 of the Summary, it works fine...but if EITHER I move my calc down a row OR if my detail drops down a row because a row was added above (where I have just header info), my summary totals change?!?! I don't understand.
Here are two examples of the calcs I'm using in the summary:
Can someone tell me what is going on? What I'm doing wrong?
I have a worksheet in which I have sorted the data based in date and numbering (column I and E). I would like to create 2 macros for following actions:
1- all rows with the value "TOM" in column C will have to be deleted.
2- all rows with a value of 601 or 602 in column E, will have to be moved to the bottom of the sheet after the last row with data. The rows that have been moved will have to be sorted based in date (column I) and numbering (column E).
I've got an excel file with over 20,000 rows with Column A being having values of a "Vendor Number" while Column B has a "Vendor Name" Here is an example:
Vendor #Vendor Name 1001ABC Supply 1002Larry, Moe, Curly Inc 1003John Smith 1004Fred, Wilma, Barney LLC
I'd like it to find the rows where the Vendor Name has a comma present, and then put it in another sheet, or in another column like column C and D. If I can't get both the Vendor # and Vendor Name re-inserted someplace, that is OK. The Vendor Name is the big one.
I have 3 columns and 200 rows. The first column is for Name of product. 2nd column for number and 3rd for $value of number of products. Have 200 rows. Have done a sort and checked. 2 sets of rows are for the same product name. I want to know if it is possible to add up values in 2nd and 3rd column, 2 rows at a time , then 4th and 5th column and so forth, by some formula rather than doing it manually?
I could get a code to move a row from one area of a worksheet to another area on the same worksheet once a cell is tagged "Paid" via a refreshed macro. The updating data table starts on Row 3 for columns "B" - "R." The paid table starts on row 56 where column "B" always has a date in its cell.
I created a outstanding task worksheet in excel and I would like to move the completed jobs from this sheet to the second worksheet titled 'Completed Tasks'. The first worksheet is called 'Outstanding Tasks'.
I came up with a code to do this (see below). As you can see when I type "Y" into column G it moves the row into the second worksheet. It does this; however it puts it to the bottom of the table on the second worksheet where I would like it to be at the top. I also would like it to delete the row once it has moved it does this but then deletes the other row of information above it leaving blank rows on either side.
I simply want a code that moves the row of information to the second worksheet when I type Y into column G and then delete the row without messing with other information around it.
Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range) Dim rng As Range Set rng = Target.Parent.Range("G5:G1000") If Target.Count > 1 Then Exit Sub If Intersect(Target, rng) Is Nothing Then Exit Sub Select Case Target.Text Case "Y" Target.EntireRow.Cut Sheets("Completed Tasks").Cells(Rows.Count, "A").End(xlUp).Offset(1) Selection.ListObject.ListRows(1).Delete End Select End Sub
I have a list of file names in Excel and I need to move the files from one folder into another. Sometimes I'm having to find and move hundreds of files into different destination folders, hence why I would like a macro. My spreadsheet will be something like:
I searched and found a couple of different active.sheet codes but could not get it to work. What I want to do is move the worksheet tab I create in the code below all the way to the end (right) of the worksheet tabs already in my workbook.
I have a small problem that is more annoying than anything else. I have a command button that opens a userform, and the user can select a value and 'OK'. On 'OK', the code runs, however I would like the sheet 'Information' to remain visible until the code finishes and then switch to 'Task Intervals'. There is also a lot of screen flicker, despite selecting it off/on. I have included an Example file so that you can see the problem.
I need a code that will allow me to move data from a worksheet to a worksheet from which I came from. e.g. worksheet "Sheet 6" opens "Sheet 10", then after filling data in "Sheet 10" I need to move this data back to "Sheet 6" in the cells in range "F12 to F56". Please note that the data in "Sheet 10" is in the same range as in "Sheet 6"
I would like to copy or move data from one worksheet to another automatically. I have one sheet (Data) with multiple pieces of data for specific individuals. I have several other sheets titled their last name. Can data for example from John Doe be copied to the sheet Doe and data for John Smith be copied to sheet Smith. In essence I would like the sheet to paste everything below John Doe to Doe's sheet and recognize the next name and past that into the next sheet and so on. It may be several different codes, Im ok with that.
One other item all cells do not have data I do need the blank cells copied as well at to not lose the formatting. There is also a blank 2 rows between each person.
If you need a copy of what the data looks like I can send it.
I have created a few macros and once I was happy that they worked independently I joined them to run as one macro in several steps. I have just discovered a bug ...
The macro filters on a column and copies and pastes that range into another sheet.
HOwever, sometimes (as I have just discovered) when it filters, there will be no data against the value it is looking for.
I need to say, if no value, move to next step.
I.e. here's my code. It's looking for ASIA and it will copy and paste all rows with Asia to another page. It then does the same for EMEA. Thing is, in my example just now, there was no EMEA data and some times there may be no ASIA data so I need to build in some rules that if it does not find either of these it continues to finish macro or pops up and says 'NO ASIA found, CLick to continue' or something?