I am trying to write a macro that will make the bottom cell in a column equal to the top cell. The top cell will not always be in the same row and there won't always be the same number of cells.
I need an easy code that searches all of column A and deletes the entire row if the cell has the value "-". It needs to find the last row of data using something like LastRow = Range("A" & Rows.Count).End(xlUp).Row
I'm trying to set a cell on one sheet to be equal to the product of two cells on another sheet. The problem is that one of the cells on the other page is dependent on the variable T. This is what I've got and it's giving me errors
I can assign a number of copies to print by adjusting ActiveWindow.SelectedSheets.PrintOut Copies:= , but what I want it to have the number of copies auto adjust to the value of a cell that contains a formula. I was hoping it would something as simple as Copies:=cell but no luck...
How to correct my formula because it does not work?
Here the formula: =COUNTIFS(Data!C2:C24005,A17,Data!M2:M11149,"<=0")
I need to insert the formula in column C (Findings tab) which counts the rows in Column M (tab named "Data") that equal A17 (Column A in "Findings" tab) and which are less or equal zero. In addition if I drag the formula down I want to only the values be entered in highlighted in blue cells in column C (SKUs With Zero Sales in "Findings" tab) and empty cells in not highlighted cells. I attached images of these two tabs: Data and Findings.
I have a set of numbers (representing time), and I need a macro that will generate a split of these numbers that both have an equal sum (or as close to equal as possible). Also, everytime the macro is run, a different split should be created.
I have a range B2:S47 that I would like a macro to copy and paste values not equal to zero in cells below the range starting from cell B49 so column values align. For example,
I have cells that they're values should be equal B6=B11, B7=B12, B8=B13, E6=B14, E7=B15, E8=B16, I want a macro that if the values are not equal then the background should be RED and a pop up message "The values should be equal".
I'm having trouble with a small vba macro. At the end of the macro I test to see if two variables are equal and then print out true or false. However, for some reason even though the variables are equal vba is not treating them that way. I have put the values that represent the variables on a spreadsheet and used the if(x1=x2) formula and it says it is true, also, when I debug the macro and watch the values when it comes to test the logical expression the numbers are the same. I don't understand why vba does not say that the two variables are equal. I have attached a screenshot of the breakpoint where I double check the values are equal.
I have a sheet in Excel 2004 for Mac that is a patient list with over 2000 patients. I need a rule that will compare values (patient IDs and responsible party ID) in two adjacent cells, if the values are different, to delete the entire row. The goal is to get rid of patients (rows) that are not the responsible party (responsible party ID).
I have two cells, both of which have drop down lists for options 'a' & 'b'. When one equals 'a' the other should be restricted into only saying 'b' and vice versa. I would also like the user to be reminded that he can only select 'a' once from the two menus. Ideally I would like to do this in a formula rather than VBA?
Simply need a cell to count another cell is equal to certain value.
For example if B3 has a value of 6 then I need J3 to equal 1 or if B3 is equal to 3 than I need G3 to equal one. I tried the the COUNTIF but I am sure i am using it incorrectly.
I would like to create a VBA code where it will delete the entire column if the cell value is equal to value in D2
For example:
Sub Delete_Columns() Dim rng As Range, cell As Range, del As Range Set rng = Intersect(Range("G2:S43"), ActiveSheet.UsedRange)
For Each cell In rng If (cell.Value) = D2 _ Then If del Is Nothing Then Set del = cell Else: Set del = Union(del, cell) End If End If Next cell On Error Resume Next del.EntireColumn.Delete End Sub
======
But I think this line is wrong but I am not sure how to fix it - If (cell.Value) = D2 _
I have a spreadsheet with some cells which return values using INDEX and MATCH to bring back the entire details of a person based on there membership number. However I require the comments to be attached with the returned values. The comments have there image in, rather than just text.
I have found some answers with vba, which do the process, however you had to manually enter the cell, from which the comment was to be copied from, into a pop up box. This involved finding the box myself to then select the box to take the comment from. In doing this I had found and read the comment, which is the is the process I'm trying to bypass.
I've been pounding away at a project for two days trying to determine a way to identify a solution, to no avail.
Here is some experimental code. Under the assumption that in Column "A", every fifth line contains some text (a, b, c, etc) I want to place a function in column B that would identify the closest occupied cell above and to the left of the cell containing the function. The sub achieves this, but the function has a problem because of the Activecell line. Is there a way to identify the location of the cell containing the function to act as a reference point for the range?
Sub find_last_heading() Application.ScreenUpdating = False x = ActiveCell.Address ActiveCell.Offset(0, -1).Select last_heading = ActiveCell.Text Do Until last_heading "" ActiveCell.Offset(-1, 0).Select last_heading = ActiveCell.Text Loop MsgBox last_heading Range(x).Select End Sub Function cathead(Optional reference)
I need to identify rows where the contents of a given cell are equivalent to the cell below. I have managed to get this working based on iterating through the cells and selecting them both for cutting.
However it doesn't work effectively: It seems to be leaving blank lines in the original sheet and further fails after the first execution. I would be grateful for any suggestions on a good method to perform the following operations: (1)to compare the cell with the cell below I have used
If cell = cell.Offset(1, 0) Then
(2)to act on the rows for the two connected rows
Sub Test4()
' Loop through rows
Dim TheExtract As String Dim cell As Range
'Application. ScreenUpdating = False For Each cell In Worksheets("Sheet 1"). _ Range("A1", Worksheets("Sheet 1").Range("A65536").End(xlUp)) TheExtract = cell If cell = cell.Offset(1, 0) Then cell.Rows("1:2").EntireRow.Select Selection.Cut Sheets("Test").Select ActiveCell.Offset(3, 0).Rows("1:1").EntireRow.Select Selection.Insert Shift:=xlDown End If Next cell 'Application.ScreenUpdating = True
I would like to program an Input Box that looks at the cell next to it to see if there is a value equal to zero in it. If there is a Zero in the cell an Input Box will popup and ask "what was the result". It would keep going down the column until there are no more values in column A.
In this example the Input Box would popup for the second line and the third line and then populate the values entered into C2 and C3 accordingly.
I am trying to write a macro which will hide and show row 15 based on the value which gets input into E9.
Part 1 here is working and when E9 = "DP Deliverable" row 15 does appear, but on the converse, when I input something besided DP Deliverable into E9, row 15 does not hude.
Private Sub Worksheet_Change(ByVal Target As Range) If Target.Address = "$E$9" Then If Range("E9").Value = "DP Deliverable" Then Call Show_DP
If Target.Address = "$E$9" Then If Range("E9").Value "DP Deliverable" Then Call Hide_DP End If End If End Sub
I currently, manually create my production work orders using excel (in-house ERP system not good enough). Rather than manually type in the names of products to be produced, I would like to have the number 1 = a production item and 2 = another and so on.....So basically when I type 1 in a cell it will automatically display a production item.
I imagine this to be a process where i would type all the names of my production items in individual cells, then create a formula to make 1 = a specific cell, 2, 3, 4, etc.....
The code below is an attempt to delete all rows where the cell in column A is not equal to the value of B1. B1 is text if that somehow makes a difference.
Dim n As Long, lastrow As Long lastrow = Range("A65536").End(xlUp).Row For n = lastrow To 1 Step -1 If Cells(n, 1) <> Range("B1") Then Cells(n, 1).EntireRow.Delete Next n
Do I need to specify that B1 will always be the cell to reference (ie $B$1). Edit: Just had an epiphany, I also need it to stop after Row 3. I have some headers and such that I don't want removed.
code that will go to a cell in Sheet1 column A that has the same or closest value to cell B11 in another workbook. The number values in the column are to three decimal places and the run in order down the column from lowest value to hightest.
I have a monthly forecast document that is updated by an operator monthly. At the end of the month, the operator presses a "Copy Accrual" macro that copies accruals for the month and stores them on a seperate tab. After sending the document back to the Finance team (necessary step due to software complications), Finance will send the operator back an updated file at beginning of next month. The operator than presses a "Paste Reversal" macro that is supposed to input the negative of the accrual stored in the seperate tab. The problem is that it is posting as the same value (not negative of value). I tried recording a Macro to fix this, but it did not work. An example of the code that came up with is:
I am working on a proforma statement, REFER THE ATTACHMENT
A B C D E F G H I J Q 1 jun'14 jun'14 jun'14 jul'14 jul'14 jul'14 Aug'14 Aug'14 Aug'14 2 beg. Inv Purchas Unit Sold Beg. Inv Purchas Unit Sold Beg. Inv Purchas Unit Sold 3 foundation 4 10 11 3 15 13 5 16 18 4 Lipstick 4 10 11 3 15 13 5 16 18 5 Shimmer 4 10 11 3 15 13 5 16 18 6 Powders 4 10 11 3 15 13 5 16 18 7 Nail Lacquer 4 10 11 3 15 13 5 16 18 8 Eye Shadows 4 10 11 3 15 13 5 16 18 9 10 11 Total Purchase for june to aug 2014 12 Foundation ??
this is just an small sample of what i am working on i have got purchases, cogs and ending invenory for 2 years Products wise i want to add purchases for the particular product. i.e. if for above data i want to find out the foundation purchased through june 2014 to aug 2014 what will be the formula