Macros: Move Data Up A Row If Row Above Is Empty
Dec 13, 2009i could do with:
move data up a row if row above is empty
move data left if column before data is empty
tia
add your top 10 if you like
i could do with:
move data up a row if row above is empty
move data left if column before data is empty
tia
add your top 10 if you like
I am importing a 20 character text string (from a barcode scanner) to H2. I need to send that data to the next unused row in Column A (after insuring that no matching text currently exists in Column A-no action taken if matching data is found). I can provide a copy of the sheet, along with a description of the project.
View 2 Replies View Relatedformula to make data on same line.On converting data2 is above data 1. I insert a column on left . Need to use mouse right click shortcut delete manually shift cells left and then delete shift cells upto have both data on same line but should be in different cells and same sequence per attached ALSO TO REMOVE "/ -DASH HYPENS.
What I need is formula to move the data2 on same alignment and to delete the two empty rows between both data.
See annexed file for expected results.I have preference to have a formula much more.
I am trying to find a macro that will filter on Column F (non-blanks - just cells with dates) cut just the filtered data (A:G inclusive)without the Header Rows and then paste/move this data to the first empty row on another sheet called "Complete"
So that I get the cells in columns A:G with dates in moved to the "Complete" tab and they are no longer in the sheet "Deliverables"
This report spreadsheet is exported from SAP. Since SAP has a limit number of displaying the columns, there are 40 headings (= 40 columns) in the report has been broken down to 4 rows of headings.
How to use macros to move 3 those extra rows to one row and the number still matches each column? I also attatch the file for reference.
The following macro does well at concatenating 2 constant values and the values in columns A and CF and places it in the CP field. What I need to know is is it possible to modify this code so if there is NOT a CF field cell value (that is it is blank) that the formula does not run and moves on to the next row? That is, the CP1 cell remains blank?
View 1 Replies View RelatedHello there,
I am making a spreadsheet that tracks children's progress in school through the year.
I have a vlookup that turns their levels (2c,2b,2a,3c,3b,3a etc) into numbers so that the number of sublevels they have progressed during the year can be reported.
=IF(ISNA(VLOOKUP(E5,$AD$10:$AE$28,2,FALSE)),"0",VLOOKUP(E5,$AD$10:$AE$28,2,FALSE))
However, when children join through the year, they will not have data to go in the 'starting grade' box, so I was wondering if it would be possible to make vlookup see that cell E5 is empty, and so look in cell F5 instead. It might even, perhaps, have to look in cell G5 if they join the class after Christmas.
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.
i need to have 6 or so cells copied and pasted into another sheet. (when a button is pressed) However before the data is pasted it checks if there is anything in the cell(s) that are being pasted into, if there is something then move down a line and paste. Here is the code i have already:
Sub Order2Invoice()
Sheets("OrderDatabase").Select
Range("B65536").End(xlUp).Offset(1, 0).Select
With ActiveCell
.Value = Orderform!G5.Value
.Offset(0, 1) = Orderform!E10.Value
.Offset(0, 2) = Orderform!E11.Value
.Offset(0, 3) = Orderform!E12.Value
.Offset(0, 4) = Orderform!E13.Value
.Offset(0, 5) = Orderform!E15.Value
.Offset(0, 8) = Orderform!E15.Value
End With
Sheets("Invoice").Select
End Sub
I have data in Row 53 that spans 7 columns, but stays in the same row. I want to design a loop to select every 7th cell in that row and check if it is empty. If not, add onto a "counter" then display the final number of occupied cells (the value of the counter) at the end. This is what I have so far, but I get all sorts of errors.
Code:
Sub Tester()
Dim WB As Workbook
Dim WS As Worksheets
Dim modCounter As Long
Dim Cell As Range
Set WB = Workbook("Transverse Series.xlsm")
Set WS = WB.Sheets(BM18)
[Code] ......
Using the following code to remove empty rows based on whether a specific range of columns is empty. The code works if the cell has a zero, but not when the cell is blank. An example of the data is attached.
VB:
Public Sub DelRows2()
Dim Cel As Range, searchStr, FirstCell As String
Dim searchRange As Range, DeleteRange As Range
[Code].....
I have two worksheets. Sheet 1 has 2 columns, Column A the restaurant's name and Column B contains the review score. So sheet 1 is kinda like this:
Restaurant |Score
Ruby Tuesdays 80
TGIF 78
Outback 92
Sheet 2, Row 1 column B-E contain restraurant names (only on the top row, like field names).. i.e. I manually put the date in because typically the projected date is different from the actual review date.
-A----------- B ----------------C ------D-------- E-----
Date |Ruby Tuesdays|Olive Garden|TGIF|Ruths Chris|
I need the data from Sheet 1 Column B moved to sheet 2 in the next open row (i currently have data in row 1..the field names and down to row 35). This will be continuous so each time i need it to add the score as a new row in the correct field (restaurant name), IF the restaurant isnt listed, I want a new field named with the restaurant name and then place the score in the correct row and column. So, in the example I'd need Outback added.
I am working on a project and would like to see if there is a solution for it. i have a workbook that has data entry that is summarized at a master level but I need to automatically use a formula to update another sheet after clicking an udpate button. The data from the data entry sheet needs to be allocated to all the lines that has the same master item based on the formula. A test workbook is attached ...
View 1 Replies View RelatedI have an month input in cells B2 (user can enter values from 1-5)
I then have a data table that has month 1,2,3,4,5 running across range G9:K9. the data is held in range G10:K19.
So if user types in 4 in B2, what should happen is that months 1,2,3 and 4 the data for these months should be cleared and data in month 5 moves forward into month 1.
So basically, anything left of the month entered is B2 should be cleared and replaced with anything right of the month in B2.
1
2
3
4
5
£11
£133
£29
£193
£100
[Code] ........
I'd like to have a sheet with multiple columns of data (say A thru K for instance.). Id like to reserve column A for ONLY imputing an X. The rest of the columns b-K would have data in the cells. I'd like to have a macro that when it saw an X in column A, would copy all of the data in cells B-K in that row, paste it into the next empty row of a second sheet (for history tracking), then go back to the original sheet and continue looking for additional "X"'s and repeat. Once all of the X's were copied, it would "clear" (Not delete because some of the cells would have formulas in them that would need to remain for future use.) the cells based on the "X" then finally move all of the remaining data up to the empty rows to fill in the empty rows. This last piece would be more for esthetics to have a clean looking sheet.
View 1 Replies View RelatedI have an Excel 2003 program that contains macros. One of the macros hides certain command bars and disables the worksheet menu bar. On close the opposite is true. The problem is, if a user uses the disable macros when opening then the worksheet menu bar and other command bars are still available. I would like to hide all of the data sheets and display another sheet that would normally be hidden displaying a message that the macros have to be enabled for the program to work correctly if disable macros is chosen. When the enable macros are used I would like the Error page to be hidden.
View 6 Replies View RelatedI have a spreadsheet where I'm copying data from one tab to another and also copying values down in certain columns. I have a "chunk" of data already on the tab I'm working on and want to copy an additional "chunk" below it. I want to fill a whole column with the same data but only in my second "chunk". So in this instance...it's an account number and all of the rows in the first chunk have account number 42243 and in the second chunk, I want it to be 78300. The account numbers will always be the same but the number of rows will not be. So for the first chunk, I was able to use the following code...
Code:
'Copies account number 42243 into column C for all lines
MyCount = Application.CountA(Range("a:A"))
Range("C2", "C" & MyCount).Value = 42243
Range("C1").Select
And right now, I have the following in for the second chunk. But obviously what this is doing is putting 78300 in the account field for the entire column, not just the second part.
Code:
'Copies account number 78300 into column C for all lines
MyCount = Application.CountA(Range("A:A"))
Range("C2", "C" & MyCount).Value = 78300
Range("C1").Select
I am importing data from access into a worksheet, and I see the data on my screen in the cells. On Worksheet_Activate, I then want to import the data and then call 2 macros which look at the cells I have imported, and if they are not empty, then manipulate or use the data in another cell. These subs all work as they should, as I can test them by hitting F8 or by running the import sub, then the subs which manipulate that data seperately. When I run them all on activate, the vba works as if the cells are empty, not doing the data manipulation, thought I see they are not empty with my own eyes. Is there some kind of update call I must make? I have tried to add Application.Calculation = xlCalculationAutomatic
View 3 Replies View RelatedI have names is Column A (about 200) and names in Column B (about 800) along with additional info in other columns. Column A was just added to an existing spreadsheet and will be deleted once I accomplish my task. The goal is to come up with the 200 names in column A along with the additional info in the other columns (address, phone) and to delete all of remaining names in B (about 600, 800-200) I'm trying to figure out the most efficient way to do this. I'm not sure if there is a function to match the text in Column A to Column B and at the same time move the row in Column A to match the row the name is located in Column B.
For example John Smith is currently in A1 and John Smith is in B7 and then John's phone number is in C7. I want the John Smith in A1 to move to A7. If I can make that happen for all 200 names I will then delete all rows with no entry in column A.
I'm working with a data logging system to collect data on a circuit. The logging software allows you to export the data collected to Excel in real time using DDE, and having talked to the logger company I managed to obtain a macro to get the data into excel (I'll put it at the end of the post). This works fine, and I can now press a button and Excel updates itself with the new data every second. What I want to do is quite complicated and I have no idea where to start:
1. The data obtained via the macro only displays in static cells, that is when the new data comes in it overwrites the old one. I want Excel to take a copy of each new bit of data as it comes in, and copy and paste it into a column on the same sheet so that it can be stored. I then want it to move down a row and take the next reading and so on, so that each time a new reading comes in, Excel takes the value and puts it in the next row down in a set column
2. Having a time elapsed measure would also be very useful, so that it records the time after starting the other macro in a column next to the ones collecting the data as described in 1. In this case, each new row would be 1 second further on. The actual time is not massively important, just the 'relative' time since the data collection started.
3. Once the data is copied into the columns to be stored (1.) I then want to calculate two sets of moving averages and place those in columns next to the data. My current plan is one average of 30 samples and another of 5.
4. Once I have the moving averages I can then get Excel to plot some graphs to show the progression of the two values
5. Since my project is revolving around detecting a short circuit in a coil of wire, it is looking for drops in resistance. I want Excel to be able to monitor the two calculated moving averages and if the difference between them exceeds a set threshold for more than 5 samples then some alarm is triggered (for now just a cell changing colour to red or a pop-up box or something).
Unsure how to start this off, any help would be great.
I have a spreadsheet with raw data in it, and am looking for a way to sort the raw data into separate sheets within excel using a Macro / VBA.
Here are the different columns of data I would like to copy into a different sheet.
Man Ord No.
Product No.
Operation Description
There is a Work Centre column I would like to use this column as a way to select the different rows of data.
So if there are five different rows of data for ACT#01 in the Work Centre column I would like it to copy the rows of data, delete all the columns that are not needed that’s all of them except for the above three, then add three new columns below.
Add a column called “Run Time
Add a column called “Resrce Name”
Add a column called “Available”
Work Centre will become the name of the sheet in Excel
The titles of the columns will have to be added in also, via the macro.
See the example excel file that I have started to make by hand, this is just one part of the process that am looking are automating there are other parts as well but just getting started for now.
i have a user form & I would like to run macros when a texbox gets data. If there a "P" I want it to do nothing but if theres an "F" I would like the user Form to unload
View 3 Replies View RelatedI have 2 different Clear all data Macros
I will post the 2 different Macros now, then explain a slight modification needed if Possible;
Sub clear()
Dim lastrow As Long
lastrow = Cells(Rows.Count, 1).End(xlUp).Row
If lastrow < 3 Then
MsgBox "Nothing to clear!"
Exit Sub
End If
Range("A3:A" & Rows.Count).EntireRow.ClearContents
End Sub
Clear Macro 2
Sub clearalldata()
Dim lastrow As Long
lastrow = Cells(Rows.Count, 1).End(xlUp).Row
If lastrow < 5 Then
MsgBox "Nothing to clear!"
Exit Sub
End If
Range("A5:A" & Rows.Count).EntireRow.ClearContents
End Sub
Basically can the following be added as a fail safe.
I assign a button to each macro (which are on different sheets in workbook).
If I click on say the assigned macro button called "Clear All" for 1 of the macros, can a pop up box appear?
And say, "are you sure you want to proceed" or it could say "Clear All" and have a "yes" and "No" check box?
Quite simply, I've accidentally clicked on these a few times
If this was included in the macro, then I wouldn't loose all my data accidentally
I have a worksheet which has data in column A but I want to repeat it until their a change in data.
I.E say cell A1 has LTP BY001 and the other cells in column A are blank until lets say A30 when LTP BY002 appears. Am I able to run a macro or something that copies the data down until the data changes and then carries on with new data until again it changes and the end of the worksheet
In the attached file (I'm sorry it is zipped, it was just too big), I gave you a snippet of my database. The actual one has 9000+ records. Over in Y4, you'll see the Sum of all the amounts (column X). Run the first macro, that is, Copy Dups, and you'll see it splits the item up by the numbers in column N. This works perfectly (or so it appears.) Then, run the Summary macro (the only other macro in there) and you will see that it pulls the Sums of each spreadsheet and places them on one nice overview page. The summary page. The only problem is, the total of the subtotals on the summary page do not match the total on the main (unadultered) page. I hope i am explaining this right. Somewhere in the macros, I am losing data from my spreadsheets so that the summary page is not equal to the un-macro'd data.
/scratches head
I have a user that keeps a maintenance log in an Excel worksheet and sends an updated copy once a week to a board member. Two weeks ago, the board member started complaining that he was prompted to enable/disable macros on opening and became worried when my user stated that no macros were used in the book. He is now concerned that we have sent him a virus.
I know the file is clean because I've scanned it, and when I look at the file in VB, there are no modules or classes present just the Sheets 1-3 and the ThisWorkbook file. None of these objects have any code in them. My user does have some macros in PERSONAL.XLS but they are not used in the workbook in question.
No one else gets the prompt for enabling/disabling macros. Even if I set my security to prompt for any macros, I get no message. I'm convinced that there must be some setting in his Excel that is causing this individual to get this message. Is there anything else other than a macro that would cause this?
to create a button,then I choose the row that I want the data to be move down..For example,when I choose the row 20,the data from row 21 to 30 will move down,and 31-40 will move down and so on....so that from row 21-30,there will be empty....
View 9 Replies View RelatedI want to use data validation so that if macros are not enabled, data validation in a particular cell will not allow any entry. Maybe a helper cell that is TRUE if macros have been enabled? How is this done?
View 2 Replies View RelatedAs you can see, I have 2 worksheets. I want that all entries in columns B,D,E and F automaticly fill in in multiple tables in sheet2. Also, if possible that macro creates tables (for example: if I have 100 rows, I want to extract 100 separetly values from column B,D,E and F and to enable automatic creation for new table - for 101 entry )
here is the dropbox link of the file:
HTML Code:Â
[URL]
So, I want when I click on the button I want to automaticly import all mentioned values into sheet 2 (I have marked with RED where to put values from which column). In this example, I expect, when I clik on Print all tables button, to print 7 tables in sheet2. In sheet2 I have 2 tables as you can see.
I have a large excel file with the following columns:
unique ID | Date | Time | D or N | Open | High | Low | Close | Volume
I would like to figure out how to create a table showing:
Date | Highest High of the Day | Time the High occurred | Lowest Low of Day | Time Low Occurred
I think this can be done in a macro where I sort first by the Date column then By the High column but I can't figure out how to get the rest.