Select Adjacent Surrounding Cells

Apr 23, 2008

If I write some VBA that selects a specific cell, for example the highest value in a coumn of data, how do I then copy a given (say 3) cells above and below (and including) this selected cell.

View 6 Replies


ADVERTISEMENT

Select Non-adjacent Cells

May 30, 2008

I've always been able to select non-adjacent cells in spreadsheets, but today noticed that I can't. I need to be able to do so to collect data from one spreadsheet to another for my monthly accounting reports. It makes collection of specific data fast and simple. Without this function, it takes far longer to do reporting and is very un-reliable. With the function working, I click on the cell ranges which are black, leaving the cell ranges which are red alone. We use black and red to identify charges which appear or do not yet appear on our monthly VISA statement.

I select all the black charges along with their corresponding account codes, then double-check the page before copying the non-adjacent ranges to make certain that all of the charge amounts and account numbers which are black on the page are selected and no red ones; then copy and paste the data into another sheet. It often makes collection very quick and easy.

When there are lines interspersed throughout a sheet with black and red charges strewn here and there, it is very easy to select only the black data and skip the red. Doing so by copying the entire range then deleting the red is laborious, and time-consuming.

What has happened to Excel's ability to select non-adjacent cells? Today, I can't select even two separate cells, using Excel's ability to do so by holding down the CTRL key, as I have in the past.

I'm using Excel 2007, on Windows Vista 64 bit; and I've made sure that my Insert function is turned off (thought that might change things?) and my Scroll Lock is turned off (I've bumped that many times in the past and found Excel doing weird things when trying to navigate a spreadsheet with the arrow keys).

View 9 Replies View Related

Select A Range Of Non-adjacent Cells

Jun 29, 2006

I have a series of data values in non-adjacent columns in an excel spreadsheet.

In the following example, assume the | (vertical bar) refers to the start of
a new cell:

F|45|A|30|F|15|F|10

Using the SUMIF formula, I want to add all numbers which are preceded by a
cell containing the letter F.

SUMIF(A1:G1,"F",B1:H1)

What I need to do is specify a range of every second cell in the row (starting with Cell A1) for validating they equal F, and a range of the alternating cells (starting in column B1) for the range containing the data to add. How can I specify these ranges (I can't name each cell individually as I have more than 30 cells to add up in my real life situation and the IF function allows selection of no more than 30 values)?

View 12 Replies View Related

Select Cells Based Value In Adjacent Column

Jan 4, 2008

How would you select cell values from differing rows based on the name in an adjacent column. ie, if it says John, add that data to the source data, if not move on.

View 5 Replies View Related

VBA Macro To Select Cells With Certain Value And Perform Action On Adjacent Cell

Mar 10, 2014

Converting old reports to usable excel format. I am having trouble using VBA to set up a looping macro that would search Column A for cells with the text string: "ACTIVITY TOTAL". If cell has that value I would like to perform text to column action on the adjacent cell (R0C1). The macro recording for the test to column settings i need is :

Selection.TextToColumns Destination:=ActiveCell, DataType:=xlDelimited, _
TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=True, Tab:=False, _
Semicolon:=False, Comma:=False, Space:=True, Other:=False, OtherChar _
:=":", FieldInfo:=Array(Array(1, 1), Array(2, 1), Array(3, 1), Array(4, 1), Array(5, _
1), Array(6, 1), Array(7, 1)), TrailingMinusNumbers:=True

I have attached a sample of what I am currently working with. The actual file has roughly 6000 lines of data, so I would like the macro to go through all lines.

Attached File : LoopingVBA.xlsx‎

View 3 Replies View Related

Highlight Cell If Surrounding Cells Close To Value

Jan 5, 2007

how can I create a formulae that

Highlight a Cell IF

Its surrounding cells are

+1 or +2
-1 or -2

away from that cell value.

Attached a file for example.

View 5 Replies View Related

Find Current Date On Several Sheets & Convert Surrounding Cells To Values

Dec 2, 2009

I keep track of values in a workbook. I accumulate them on a daily basis (business days) and keep track of the older values.

On the first sheet I have all current values automatically displayed.

All subsequent sheets contain the values for the different locations (>60) by one location per one sheet with multiple entries per location.

Most of the values do not change daily. So I copy the values from the previous day and paste them to the current day’s fields (the row below yesterday's values).

Today’s date (and prior dates as well as subsequent dates) are in column A, the values to be copied are in column B through AZ. With over 60 sheets this job becomes very tedious very quickly...

What I would like to be able to do, with a click of a button, is to go into each sheet (except the first one), go to the current date (in column A), select the field to the right of that date (in column B), go up one field, select both fields (today and last business day) and go from B to AZ (or A to AY in relative terms) copy all those entries, go down one field (to the same row as today’s date) and paste the content. Then repeat that for every following sheet…

As the date field that I am looking for goes down one field with each day I cannot use fixed points to copy and paste from, but have to use the date field as an anchor from whence to find the proper cells.

I do have some values in the following day's fields, that is why I need to copy two rows and not just the values from the previous day...

View 4 Replies View Related

Copy Non-adjacent Cells In A Row From One Spreadsheet To Adjacent Rows In Another

Jan 5, 2014

I have a workbook with 30 worksheets. Each sheet has 84 rows of data (start in 15 columns (A to O). I would like to create a summary sheet that only shows the most important data from each sheet.

The summary sheet would have 12 lines of headers and formatted crap at the top.
The Summary sheet header columns would be:

Site (A), Date (B) Health (C), Status (D), Critical (E), Task (F),
Dependencies (G), Owner (H), T-Date (I), Task Date (J), Mitigation Date (I)

The data in the sheets are not in that order, of course.

That
1. puts the name of the sheet I am copying from in column A
2. the deadline date in Column B (that date is always in C10 of each worksheet)
3. and copies Cells from Column A,B,G,H,I,O in any row in which the value in A is not "good" into columns C through H. I would like to paste those rows into the summary sheet. I have code that loops through the sheets and rows in each sheet to find the rows to copy. I can copy cell values directly from the active sheet to the summary sheet, but because I am copying a cell at a time, it takes 7 minutes. Yes I am impatient :)

Here is the code snippet where the copying is done:

Dim sh As Worksheet 'current worksheet
Dim DestSh As Worksheet 'worksheet in which to paste summary
Dim Last As Long
Dim CopyRow As Long 'row to copy
Dim LastCopyRow As Long

[Code] ........

ExitTheSub:

Application.Goto Sheets("KMARollup").Cells(1)
End Sub

I think there must be a way to use ranges to build an array of cell values and paste only once but I am lost here.

View 2 Replies View Related

Select Adjacent Range ..

Jul 30, 2008

I only want to select the adjacent range from

Range("A2", Range("A2").End(xlDown)) to the left

View 11 Replies View Related

Surrounding Scoring Data

Feb 16, 2009

I have a small query about excel and whilst there is a really simple answer i'm struggling a little bit. I have create a score metric for data surrounding search data.

Basically i need a macro/formula that will take a list of values that may include duplicates and add up the corresponding score and place the results in a table.

See below - the macro will look at a list of values (column b) and add the scores up (column d) and then remove the duplicates and populate the score in (column f/g)

View 9 Replies View Related

Sorting: Keep Surrounding Data Intact?

Mar 5, 2009

I was given a spreadsheet this morning for sorting and am a little lost. I've attached a sample. I'd like to sort the spreadsheet from high to low in terms of gift amount. The problem is that if I sort the Gift Amount column, all of the surrounding information gets sorted as well, messing up the layout. I know I'm missing something here. Is there any way to tell Excel that if it sorts something, sort the surrounding data as it is? Maybe by giving it a range name?

View 4 Replies View Related

Remove Portions Of Formula Based On Surrounding Characters?

May 13, 2014

I have about 25 workbooks with 180 formulas in them that I would like changed. The formulas are all in the range I10:Q29 and all have the same basic structure:

[Code]....

I would like to remove "filepath1!cell1*filepath1!cell2-" and "filepath1!cell2-" so that only "(filepath2!cell3*filepath2!cell4)/(filepath2!cell4)" remains.

My VBA is pretty weak, but I imagine it should be possible to use something like the VBA equivalent of len() and mid() to isolate the components of the equation to the left of the - in the numerator and denominator, and remove those components (as well as the -) from the formula.

Attached File : trim formulas.xlsx

View 12 Replies View Related

Plotting Surrounding Zip Codes Based On Longitude & Latitudes

Aug 10, 2007

Having the Zip Code Tabulation Module from the US Census Bureau, I have the following and much more. But based on the 3 items :
5-digit Zip Code, Longitude, Latitude.

I'm wanting to Select a Zip Code and have (let's say) several Zip Codes plotted (maybe 4 - 10) out from the center point of the map.
either with, or without a connecting straight line .

And possibly a Scalable Miliage indicator |---- 10 Miles ----| which would be based on the distance.

View 9 Replies View Related

Find Cell Value & Convert Surrounding Range To Values

Aug 1, 2008

I'm trying to create a spreadsheet to update daily, whenever our market intelligence arrives by email. I'm not trying to write a macro which can select a range of cells (G:L) relative to the date in Column B, which represents the value in cell P6. In other words:Read the value of cell P6 Find that value in column B (e.g. B646)highlight the cells in columns G through to L on that row (e.g. select G646:L646) I am then aiming to paste the values in that range of cells, so that those stay in the spreadsheet and are not lost when the next lot of figures comes in the following day.

Range("G646:L646").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
ActiveWindow.SmallScroll Down:=12
Application.CutCopyMode = False
ActiveWorkbook.Save

but that's obviously a static range, rather than looking up the date first.

View 2 Replies View Related

Highlighting Cells If Specific Data Appears In Adjacent Cells

Mar 18, 2014

I have a couple of spreadsheets that has several columns each containing several hundred thousand rows of codes. To quickly analyze this data, I am trying to come up with a conditional formatting formula to highlight the respective cells when specific values occur next to each other. A particular code will show up in many cells, but the code that is the respective adjacent cell is always different. I need to know when row A contains, for example, '9928559' and row B contains '36415RT'.

View 3 Replies View Related

Merge Date From Adjacent Cells Inbetween Current Cells

Nov 17, 2009

I have 2 columns of data and want to be able to merge as follows

COL A COL B
4123567 123.45
4125467 900.56
4356456 456.32

need to get result of

COL a
4123567
123.45
4125467
900.56
4356456
456.32

View 4 Replies View Related

2003 - Merging Four Adjacent Cells With Text And/or Blank Cells

Jun 14, 2008

I am trying to merge text, in four adjacent cells in the same row (say cells A1,A2,A3 and A4), into a single cell (say cell A5).

I would like a comma or full stop and then a space between each item merged (cell A5).

The text to be merged may appear in any one of the four cells (cells A1 to A4). Those cells without text are blank.

Only where all 4 cells are blank, will I need cell 'A5' to indicate this.

The formula needs to be relative as I will need to copy the formula down the spreadsheet so that it applies to additional rows.

View 9 Replies View Related

Color Cells Based On Adjacent Cells Being Empty & Add Text

Apr 2, 2008

I’m trying to make my life a bit easier, by adding a few macros and formulas to the spreadsheet (Everything was done completely manually before I got here!!!).
What I would like to do is take two columns, which contain a start and end time for work shifts, and colour them GREEN once I have entered a name in the Worker column (Along side the two with the time), and also to fill a cell with a Yes or a No. I’m aware of auto conditioning, and I’ve tried to have a play to get this to work, but I just can’t work it out.
I have posted a link to an image which shows what I want. I hope I've explained it well enough!

http://img530.imageshack.us/img530/6239/excelspfk0.jpg

View 9 Replies View Related

Fill Empty Column Cells With Reference To Adjacent Cells

Aug 11, 2008

I would like a macro that when run, finds empty cells in a column within the used range and fills them with the same formula in the other cells in the same column but relative to the row.

I have a basic understanding of VBA so if someone can set me on the right track i'll have a go myself as i appreciate this would take a while to write out from scratch.

View 9 Replies View Related

Calculating Sum Of Cells Only Where Adjacent Cells Are Blank

Oct 17, 2008

Code:.....

I am constantly editing this (we currently have over 100 accounts) and therefore the totals are changing.I have a formula for Total but I need formulas for the other two, based on when the cells in columns F and J are blank or have dates in them: For active, the total is the sum of all numbers in column M but only when there is a date in column F and a BLANK in column J. For yet to enter, the total is the sum of all the numbers in column M but only when both column F and column J are blank. At the moment, my accounts run from row 6 to row 142, with the first line of totals in row 145, however this is constantly expanding.

View 4 Replies View Related

Total Cells Based On Adjacent Cells

Jun 28, 2008

I have multiple sheets cataloging multiple vehicles' mileages in multiple areas (one sheet per month). I want to reorganize this data by Vehicle ID rather than month.

Here is an example spreadsheet to help explain

I have attempted this by writing this formula ...

View 3 Replies View Related

Sum Up 5 Adjacent Cells

May 16, 2006

As per the attached file – I am trying to mark (with an X) the first 5 Adjacent cells which SUM up (and above) 480. As you will see, in some instants, one of the 3 formulas is correct. I am looking for a formula to work correct IN ALL situations.
In Col. A I marked (light Blue Background) the FIRST 5 cells which meet the Condition. In Col. F are the sum results and those which meet the Condition
are in Bold RED.

View 2 Replies View Related

Linking Adjacent Cells To Each Other

Jun 26, 2008

I need to have three rows link to each other. The first column cell A is a paste link and is always changing. The second B is a vlookup referenceing A and finding it in a changing table...the source for the paste link. C needs to follow the other two cells and remain "attached" to it. However, C has to be a cell that is hardcoded somewhere, meaning that C is not found in the source data and must be determined by a person. I have tried to link the sheets through vlookups and other formulas, however, this only works when the data is sorted and nothing new is added. I need a static sheet that can take in new values. I need to create some sort of relationship between the cells

View 14 Replies View Related

Calculating A Sum On Non Adjacent Cells Across A Row

Jun 17, 2009

See the attatched spreadsheet. I can not seem to figure out a formula that will calculate the totals for each type of data.

My goal is to have a sum for each location for # of audits, Critical Counts, and Major Counts.

View 2 Replies View Related

Linking 2 Adjacent Cells?

Mar 6, 2013

I have list of names of people in a billboards league. Directly to the right of everyone's name in the adjacent cell is their "win percentage". These percentages are sorted in descending order and I need the names to move along with the adjacent cell as the percentages change. When i merge the cells things get really messy.

View 1 Replies View Related

How To Reference Adjacent Cells

May 23, 2013

I need the syntax that allows me to reference the cell directly beside my target cell for each row in a column

Like:

Col A Col B
S D
T F
S F

If i was targeting Col B

View 6 Replies View Related

How To Count Adjacent Cells

Feb 3, 2014

In the following spreadsheet, I'm trying to automatically count the amount of times an A code (A1 or A2) or B code (B1 or B2) appear under each person's name in the K1:M5 table.

View 3 Replies View Related

Sum 3 Non-adjacent Cells Some Are Blank?

Mar 5, 2014

I am trying to sum 3 non-adjacent cells. Some cells are blank, not always in the same row / column, and all are the result of vlookups. I tried: E = I+M+Q, but the result is #value!

-In column E (respectively F, G, H) that's where I want the result of the sum

-In column I (respectively, J, K, L), depending on the row, some cells are blank and some cells contain a number. That's the first term of my sum.

-In column M (respectively N, O, P), I have also blank and non-blank cells, depending on the row. This is the second term of my sum.

-In column Q (respectively R, S, T), also blank or non-blank cells. This is the third term of my sum.

I will need to extend this formula to F=J+N+R, G=K+O+S, H=L+P+T, and probably also a sum with 4 terms where E=I+M+Q+U etc.

View 2 Replies View Related

Average Non Adjacent Cells If Not 0

Sep 10, 2008

I am trying to work out a formula for calculating average of non adjacent cells but it should ignore any cells with 0:00:00 value or are empty.

At the moment I am using the simple formula =average(A1,A2,A5,A9). But if any of these cells is empty or 0:00:00, it then gives me a wrong average. I could have used a array formula with if function but it then calculates all other cells in between as well that I don't want to e.g. I may not want to include include A3 in my calculation but as it has some value in it, it gets in the calculation and gives the wrong answer again.

View 9 Replies View Related

Sum Cells Adjacent To LARGE Cells

Feb 27, 2014

I have 500+ rows of data in column A (Credit), with corresponding data in column B (Cash). I use "=SUM(LARGE(A:A,{1,2,3}))" in C1 to find and sum the three largest "Credit" entries, how do I sum the corresponding cash values associated with those three large credit entries?

View 9 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved