Shift Cells left whle filtering in ms excel 2007 - excel-2007

I have a table and i filtered data based on one specific criteria and i want to shift cells left after deleting one selected column data.
Please help.

hey simply use = sign in require left cell and put column position which you want to put e.g if you have data in B1 cell & u want to put the data in A1(left) then simply write =B1 in A1 cell
and drag down upto where you want the data

Related

Excel code to look for a specific text in a cell (from a list of possible texts) and populate another cell

So I am populating a spreadsheet with a copy n paste of my banking transactions. I want excel to populate a cell 10 to the left of it with that specific costs cost centre number.
Eg, Petrol has a cost centre number of 10
I copy and paste my bank statement in, the sheet sees all the cells containing 'petrol' and populates the cell ten to the left with a 10
I do not want to do this with a formula, I want to put it in vba.
Can someone help please?
Thanks in advance
You can use the following code to copy a value ten cells to the left.
Cells(Row,Column).Value = Cells(Row,Column + 10).Value
To get the values for 'Row' and 'Column', you can use the find function to find the address for 'petrol' and all the other values that you want.

VBA Drag down Vlookup

All,
I have a data sheet of around 1.000 values which need a matching amount (the amount of valueschanges every day) . These amounts can be found in another tab "Data".
so using a Vlookup code in VBA should help me. The code I'm using is:
Sheets("Data").Range("E2") = Application.WorksheetFunction.VLookup(Sheets("Data").Range("D2"), Sheets("Blocked").Range("C:D"), 2, False)
Result should appear in column E responding with the row of the lookup_value which can be found in column D.The table and column index don't change being Sheets("Blocked").Range("C:D")and 2
This code gives me the result I wanted but as I tried to drag down the formula with this function:
Range("E2").AutoFill Destination:=Range("E2:E440")
How can I drag down this formula without needing to create a seperate vlookup for each row?
You should use the Formula as an R1C1 reference and then u will be able to drag down
Sheets("Data").Range("E2").FormulaR1C1 = "=VLookup('Data'!R[-1]C,'Blocked'!C[-2]:C[-1],2,0)"

Splitting data into two columns

I have a very large Excel spreadsheet that looks like this:
However, I want to move every cell in the second column that starts with Location to the next column.
So it would look like this:
No need of VBA
Enter this formula in C2 and copy till last record
=IF(LEFT(B3,9)="Location:",B3,"")
Then copy paste values in column C, filter column B for Location:* and clear the resulting cells in column B or delete the rows (do as needed).
I would copy column B, paste it in column C then select C1 and press ctrl-- (CTRL and Minus together)
Select shift cells up and click OK.
Then either sort by column A or filter out any with a blank in column A.
You can also use this:
=IF(ISNUMBER(SEARCH("Location",B2)),B2,"")
Then apply conditional formatting to your data range as following:
Final Result

excel vba: Specific data columns moving to the right

I am having trouble with writing a small code of VBA that does the following: In a huge dataset, search a particular column for entries that are obviously wrong (e.g. being above 50,when they should be from 1-10).I want this to find these entries,and copy alla the columns to the right of it and move them 3 columns further to the right.It is some sort of data cleaning.Thanks
Not sure why you would need VBA. Lets say that column A should be populated with numbers between 1 and 10. And columns B,C and D are populated with other data.
Select cell E1 and put in the formula =IF($A1>50,A1,"") in the formula box and push CTRL + Enter.
Use the drag handle to copy the formula into cells F1, G1, and H1.
With cells E1 through H1 selected, double click on the drag handle of cell H1.

How to display a value of a cell using the LARGE formula feature

In Excel using the LARGE function I have listed the top five values in the range of cells C2:C13 into the cells F2,F3,F4,F5,F6. I used the following formulas in the corresponding cells to do so:
Cell F2 I used this =LARGE(C2:C13,1)
Cell F3 I used this =LARGE(C2:C13,2)
Cell F4 I used this =LARGE(C2:C13,3)
Cell F5 I used this =LARGE(C2:C13,4)
Cell F6 I used this =LARGE(C2:C13,5)
Here is a screenshot:
However, what I would like to do is to display the value of the cells to the left of the five greatest values. Below is a screenshot of how I would like it to work if possible:
Please try:
=INDEX(B:B,MATCH(LARGE(C$2:C$13,E2),C:C,0))
in F2 and copy down.
If purely for display purposes you might filter ColumnsB & C an apply a "Top 10..." selection for 5 items.
We could 'cheat' and manage without INDEX in the example provided but, for wider applicability, having chosen the top five values in ColumnF these are then MATCHed to their row numbers in ColumnC and the corresponding row number fed in to the INDEX function to determine the B value.
The following is tested in Google Spreadsheets.
This would be a simple solution:
=MATCH(LARGE($C$2:$C$13,1),$C$2:$C$13)
=MATCH(LARGE($C$2:$C$13,2),$C$2:$C$13)
=MATCH(LARGE($C$2:$C$13,3),$C$2:$C$13)
=MATCH(LARGE($C$2:$C$13,4),$C$2:$C$13)
=MATCH(LARGE($C$2:$C$13,5),$C$2:$C$13)
Another more precise way:
=LOOKUP(LARGE($C$2:$C$13,1),$C$2:$C$13,$B$2:$B$13)
=LOOKUP(LARGE($C$2:$C$13,2),$C$2:$C$13,$B$2:$B$13)
=LOOKUP(LARGE($C$2:$C$13,3),$C$2:$C$13,$B$2:$B$13)
=LOOKUP(LARGE($C$2:$C$13,4),$C$2:$C$13,$B$2:$B$13)
=LOOKUP(LARGE($C$2:$C$13,5),$C$2:$C$13,$B$2:$B$13)