Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Excel


Identify Cell Address Of Active Cell Selection

I have an embedded chart on my worksheet.I can select a cell behind the chart using the keyboard arrow keys.Is there a way of doing this using a mouse click,so that I know which cell i am pointing to/choosing?

View Complete Thread with Replies

Sponsored Links:

Related Forum Messages:
Identify Active Cell And Use The Column To Add Formula To Another Cell
I have a range of unlocked cells (B5:S10) that users enter data in. This sum of this data is then charted. The formula (sum) in a cell equals zero even when there is no data entered by the user. This zero is then charted.

I need to be able to plot the zeros if the user enters zeros but not plot the zero if the cells are blank.

What I was attempting to do is to use the worksheet change event to add the formulas to a cell so that the chart does not plot the value until something was added.

In my change event I need to know that a cell in the range (B5:S10) was changed and that if it was D7 (for example) that I need a formula enterd in D11 [=SUM(D5:D10)]. If it was I5 then the formula would have to go in I11 [=SUM(I5:I10)].

View Replies!   View Related
Previous Active Cell Address
I need to locate the address of the previous active cell without triggering a selectionchange event (as this is where my code is activated from). Here is what I am currently using unsuccessfully:

strPrevAddress = ActiveCell.Previous.Address

View Replies!   View Related
Formula That Returns Address Of The Active Cell
Is there a formula in Excel that returns the active cell address (ie dynamically). Excel updates the activecell address in the Name Box dynamically as you make a selection but I cannot find a standard formula to access it. I know I can achieve this with code using the selection-change event but this action then disallows use of the Undo button - which I specifically want to avoid. Perhaps there is an add-in available?

View Replies!   View Related
Replace Cells In Selection Same As Active Cell
I need some sort of code to check through a selection of cells in a column and make those cells "zero" whose value is equal to the first cell in the selection. e.g., let's say I have a key value entered in cell e6 = "2.99".

E6 F6 G6 H6 I6 J6
2.99 5.25 2.99 2.00 2.99 5.00

So the macro should be able to check the value in cell E6 (i.e. = 2.99) against values in cells from F6: J6 and any cell having the same value as cell E6 (2.99) should be made = 0. So, in the above example cells G6 & I6 will have "0" value after the code has been executed. I have close to 50 rows going down starting from cell E6. For example, E7 has a value which has to be checked against the range starting from F7 to J7 and so on and so forth.

View Replies!   View Related
Extend Selection From Active Cell To Desired Column
1st post so hope that title isn't too vague.
Using VBA, I have a macro that will find a column based on a week number and add in a new column.
It will then offset the ActiveCell down one.
I now need the macro to SUM all values in that row to the left of the ActiveCell.
My original thought was to use:

ActiveCell.Offset(1, 0).Range("A1").Select
Range(Selection, Selection.End(xlToLeft)).Select

Unfortunately, there are gaps in the data field, blank cells that should count as zero value.
How can I highlight all cells to the left, from whichever column the active cell is in, through to column B?

View Replies!   View Related
Identify Rows Where A Given Cell Is Equal To The Contents Of The Cell Below
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
ActiveCell.Offset(3, 0).Rows("1:1").EntireRow.Select
Selection.Insert Shift:=xlDown
End If
Next cell
'Application.ScreenUpdating = True

End Sub

View Replies!   View Related
Increment Cell On Selection And Lock/Protect From Re-Selection
I tried very hard to design a leave roster for user to mark their leave application. The criteria are as follows:

1. 4 applications per date
2. a region of worksheet (i.e. "A2 to H20) will be defined for users to "click" on the cells (within the defined region) to mark their application.
3. once a cell is clicked (i.e. marked), it cannot be altered.
4. each click will automatically increase the total by 1.

I got the following code to deal with the situation but user can still click on any cell outside the region (in fact I fail to define the region).

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim m
ad = Mid(ActiveCell.Address, 2, 1)
m = Range(ad & 24).Value 'here a formula "CountA(A2,A20)" will be place in the cell (24, c).......................

View Replies!   View Related
Incorporate Adjacent Cell In Formula W/o Naming Cell Address?
I searched and I keep finding something that's not quite what I'm looking to do so I think I'm missing something really simple.

Let's say that I want each cell in col b to be the sum of 5 plus whatever value is in the cell adjacent to it on the left (col).

I know that you can just write a formula in each cell like...

b1 will be =sum(a1+5)
b2 will be =sum(a2+5)

... but is there a shortcut so that you don't have to write out the actual cell address for each one?

Meaning - is there a predefined name or something that represents the cell to the left or right so you can just use that instead, allowing you to just copy paste the same formula all the way down the column? Something like...

b1 will be =sum(left+5)
b2 will be =sum(left+5)

... where "left" represents whatever value is in the cell to the left of that particular cell?

View Replies!   View Related
Detect Cell Address Of Cell Directly Under Mouse Pointer
I've a sheet that presents the profitability of sales locations in a geographic layout (similar to Tables in a restaurant), each sales location is a cell, with roughly 1,600 locations presented. Each location is colour coded based on performance / measure, in a basic thermographic way [e.g. dark blue for very poor, solid red for high performance] with users being able to change metrics and re-colour cells accordingly.

The sheet is already information rich, but I'm wanting to detect the cell address directly under the pointer and populate a text box or other cell based on the value in the cell directly below the mouse pointer.

My question is; Is there a simple way of detecting the mouse position on the XL Grid? nb. Want to avoid having to activate cell beneath pointer.

View Replies!   View Related
Looking For A Solution On How To Convert A Returned Cell Address To A Cell Reference
I have a formula (AL15) to determine the address of the last column with a value greater than 1. =COUNTIF(C16:AC16,">=1")+2. I then use this column value to aquire the Absolute row "15" and the determined column=(ADDRESS(15,AL15,4)). This returns to me a Column value and row value that I need to use as a refference. How can I convert this returned value to a reference.

View Replies!   View Related
Formula That Returns The Cell Address Of The Last Cell > 0 In A Range
I am looking for a formula that returns the cell address of the last cell > 0 in a range.

in the example: A1CLA23 8

the result should be A7.

View Replies!   View Related
Obtain Cell Reference/address Base On Cell Value
I have this certain value "Y" in all the sheets. In the summary sheet, I would like to get the cell address for this value in a given sheet. I know that you can get cell address using CELL worksheet function. However, for that you need to know the reference to the cell, which is what I am interested in.

I tried Hlookup to get column #. But couldn't figure out how to convert the number to letter so that I can use MATCH to get row # and then finally, index or address function to what I am looking for.

If someone knows how to convert column # to column letter OR knows a better/easier way to obtain cell reference/address based on cell value,

View Replies!   View Related
Access A Cell's Contents Via A Variable Containing Cell Address??
How can you access a cell's value via a vb variable that contains the cell's address. I have a vb variable named cellAddress (string) that contains "$A$1" and I want to assign the contents of what cellAddress points to another VB variable - how do i Do this?

e.g. if cellAddress = "$a$1" and A1 contains "xyz", I would like to assigne "xyz" to a new vaiable by referencing just cellAddress??? Also - Can anyone reccomend a good Excel VB book? A book that maybe stresses the VB language rather then a cook-book approach.

View Replies!   View Related
Formula/Function Reference To Cell Address In Another Cell
how can I use the cell function inside a NPV fuction as one argument of the start for the NPV string to calculate?

View Replies!   View Related
Read Workbook, Worksheet & Cell Address From Cell
Display Alert On Closing If Cell Not Filled In

How do I alter this code so that it acts like an INDIRECT function so will pick up a cell reference in another cell?

I can't just use A1 as I want this to change dynamically.

View Replies!   View Related
Assign Active Cell In Macro With Dynamic Cell Choice
Before unloading a userform the range to select the active cell is set to

View Replies!   View Related
Go To First Cell In List That Matches Contents Of Active Cell
I am just learning to use VBA and this may be the most simple task ever, but I can't figure it out. I've searched for all of the keywords I can think of, but can't find a solution...

I have a list of names in a sheet. Other columns in this sheet contain data like amount charged, amount paid, etc. This sheet must be manually updated (because the other program won't export the information I need) periodically to ensure proper billing/payment application in the original software (all transactions are handled by other people that I don't trust).

I sort the list so that the all names that are the same (ie John Doe) are together.

A short example list looks like this:

Jeremy Apple
John Doe
John Doe
John Doe
Jimmy Kravitz
Jimmy Kravitz

In updating my sheet, I set up a macro that will input todays date in one of the columns for all occurences of that name (so, every row that contains John Doe in column B, column V will have todays date in it).

Currently, in order for my macro to work properly, I have to manually make the activecell the first occurrence of 'John Doe'. When I'm ready to update 'Jimmy Kravitz', I have to select the first occurrence of 'Jimmy Kravitz' and so on.

Here's my question - Is there a way to use a VBA macro to find the first occurrence of 'John Doe' (and automatically 'know' which name I am updating)? Basically, I need a macro that will take the information that is in the cell in column B in the active row, find the first row that has that same name, and make that cell (column B) the active cell...

View Replies!   View Related
Return Maximum Of Active Cell & Arbitrary Value To Cell
I am looking for VBA that will add the value of the current active cell on the sheet to the value in cell F12. The maximum value of F12 cannot exceed 1000. So if the value in F12 = 950 and 100 is the value in the active cell the maximum value in F12 should show 1000, not 1050.

It should do this on the click of a button.

View Replies!   View Related
Formula Reference Cell Address In Cell
I have 2 sheets. In the first sheet, I have 3 columns. The first column contains transaction codes. The 2nd column contains the destination code (like a mapping cell where the value of the 3rd column would go but in a different sheet/2nd sheet) and the 3rd column contains the values for it. Would it be possible to reference a destination in a cell itself? Or should I just code it individually? I wouldnt want to reference each data one by one because the total would be 480 reference cells. Is there an easier way?

View Replies!   View Related
Input Cell Address In Vba By Clicking That Cell
Is it possible to input a cell address in a VBA macro by clicking in that cell?

View Replies!   View Related
Use Number In Cell To Create Cell Address
If I added two numbers together in one cell - how can I use the result as a cell address? example. A3=23+5 now I want to use A3 (or 28) as a cell address resulting in D28

View Replies!   View Related
Formatting Cell Currencies Based On A Selection In A Single Cell
I would like to format cells with a currency based on a value selected at the top of my worksheet. Cell C3 is a drop down of currencies. And I would like cells range E11:E200 to format in whatever currency selected in cell C3.

View Replies!   View Related
Return Address,Value,Column/Row Of Selection
I am wanting to allow the user to select a cell in a worksheet and return the cell address and information/value from the cell. For example, if "Dog" is in cell A1 and "Cat" is cell A2 and the user initiates the Macro I would like the macro to to pop up a message box and say something like "Select a cell in Column A". When the user clicks on cell A1, I would like the message box to pop up and say, you selected "Dog" in cell A1.

View Replies!   View Related
Add Active Cell Data To Cell By Clicking
I want to automatically put information from several cells into one cell, when these cells are clicked. Let's say that A1:J8 is the range were a cell can be clicked and if a cell is clicked in that range the value of these cells should be put in cell A9. If possible I want to avoid private subs in a worksheet. I preffer to have a macro running, so I can decide when to stop this routine.

View Replies!   View Related
Identify Cell Text In Loop
This sub routine is in the middle of a macro that runs down a list of file names, opens them and updates all links. So no problem there works fine....

View Replies!   View Related
VBA To Identify If A Cell Is Colored Green
I am trying to figure out how would be the best way in VBA to identify if a cell is colored green (column C) then in column L I want to say "YES" else nothing.

I have came up with a count so I know how many records to look at but have nothing from there.

Public Sub KPI()
Dim cls As Object
Dim i As Integer
Dim rng As Range
Set rng = Range("C9:C100")
For Each cls In rng
If cls.Value "" Then
i = i + 1
End If
End Sub

View Replies!   View Related
If Lenth Code To Identify Cell
We are trying to use the following IF len code to identify cell d5(in currency format) when it equals $0.00:

If Len(Sheets("Parrs").Range("D5").Value) = 1 Then
Cancel = True
MsgBox "Test"

View Replies!   View Related
Identify Sheets Having At Least One Formula Containing Cell
I am trying to loop through all the worksheets in active workbook. But I want to ignore all those sheets which does not have a single formula containing cell. I mean if the sheet has at least one cell with a formula then the loop should work on that sheet else ignore that sheet.

View Replies!   View Related
Identify Cell Data Type
How can I identify a cell type at excel sheet (w/ VBA command) ?
I find this command (from Access forum):
but its working only with Access...

View Replies!   View Related
Identify First Cell Of Print Range
I'm looking for a way to identify the first cell of a page without using the pagebreak function: Sheet6.Range("B" & Sheet6.HPageBreaks(i).Location.Row). The reason being is for overall speed and performance as well as avoiding <out of range> errors on the last break. If I use totalPages = Sheet6.HPageBreaks.Count + 1
to determine the number of page breaks, is there a way to identify the first cell of page i in this way?

View Replies!   View Related
Investment Selection With Cell Selection
I'm trying to build an investment calculator. Tried searching "calculator" as keyword but return nothing similiar.

There are eight cell : [ A ][ B ][ C ][ D ][ E ][ F ][ G ][h]

[ H ] is price of the leverage

[A] is X balance
[b] is X lot size
[C] is X amount of money use to get x lot
[D] is X percentage of money use to get x lot
[E] is X point gain
[f] is X money gain
[G] is balance + money gain

Ignore the formulae for leverage to determine 1 lot price. Take 1 lot = 250.

What I'm looking for is when I enter any value at cell B, C or D, it will automatically calculate the value for either B, C or D cell.

Let say, the balance is 10000.

If I enter 2 at cell B. Then, it will calculate the value for cell C & D.

If I enter 750 at cell C, then it will calculate value for cell B & D.

If I enter 25 at cell D, it will calculate value for cell B & C.

how to use OR Selection in excel.

View Replies!   View Related
Automatically Show Range Address Of Selection
does excel have a function or some kind of method where you can have it display the range of cells that you have selected? For example, if I highlight cells A5:G7 what would be the code for excel to display "A5:G7" in a message box? I need this to be dynamic, so the next time I select cells B3:T32, it needs to display "B3:T32."

View Replies!   View Related
Automatically Identify Ranges Given The First Cell Of An Array
way for excel to automatically identify ranges given the first cell of an array.I guess the concept is simple:

Lets say given A1 is the top left corner then excel should look the offset columns for values and/or formulas,when nothing is found and a blank cell is found then that's the border column.Then same goes for rows,and when bootom row is found then the bootom right cell can be identified and array/range is found!

So how can that be done inside excel?

View Replies!   View Related
Separate And Identify Text From Numbers In One Cell
I am working with reference numbers which follow the following format:

first section:


Second Section


View Replies!   View Related
VBA To Identify Top Left Cell Of A Selected Range
if a user has selected a range, how do you, in VBA, identify the:

1. Top left cell
2. Bottom left cell
3. Top right cell
4. Bottom right cell

For example if user has selected the range B5:M30, then we would want to identify in the macro:

1. Top left cell = B5
2. Bottom left cell = B30
3. Top right cell = M5
4. Bottom right cell = M30

View Replies!   View Related
Convert Cell Address To Corresponding Cell..
I have two columns in my worksheet that represent a graph: the A column has x values and the B column has y values. I want to be able to find the x value that corresponds to the max y value.

I am currently using:

This function gives me the cell location of the y max, but is there a way to convert this to the corresponding x location? For example, if the above function outputs $B$1569, I want to know what the value of $A$1569 is.

View Replies!   View Related
Identify Bottom Left/Right Cell In Named Range
Is there any easy way to identify the bottom left cell in a named range?

View Replies!   View Related
Copying A Selection From A Listbox To The Active Text Box
I am using a form which has 3 text boxes and a list box. How do I copy the selection of a list box to the text box based on my active text box. So, if I was in text box1, and I click a selection in listbox1, it copies that selection to textbox 1, etc.

View Replies!   View Related
Get Value From Another Cell Using Offset And Active Cell
Get value from another cell using Offset and active cell. I can do this in VBA but I cant seem to do it on a worksheet.

View Replies!   View Related
Name A Active Cell Which Ever Cell Is Activecell
I need to name a cell that is the active cell. The active cell can be any cell that is selected at the time I need to name it. I can get it to name the cell using the cell address, but I don't know how to change it to the active cell. Below is the code that I tried, but the syntax that I tried to say what cell is to be named simply isn't correct.

View Replies!   View Related
Get Value Of Cell Adjacent To Active Cell
I'm trying to compare two lists of foods, one input by a user (together with number of servings consumed), the other a list of foods with their calorie content. Then I'm trying to get the number of servings associated with the user's input (in a cell adjacent to the one I'm in for the comparison/search), and get the calorie content of that food from the list (also in an adjacent cell), so I can multiply the two to get total calories consumed. However, I'm getting, variously, "Wrong number of args," "Type mismatch," "Application/Object-defined error," and so on.

The code below shows what I've tried, and I think I'm doing something braindead basic wrong, but I can't find what my error is. Everything works in the snippet (that is, I've correctly Dimmed the variables, I get my food match, and the row indexes keep up correctly), except the attempt to write, for instance, the number of servings to the variable 'o'. That cell ref fails.

m = 7 'initializes the row index of Daily Data block of the Inputs sheet for the food items
n = 2 'initializes the row index of the Data sheet for the food items
r = 0 'initializes value total carorie content of food item across number of times eaten in a day

For Each Food In FoodName 'the User-input food
For Each datum In DataList 'table containing food's calorie content
If Food.Value = datum.Value Then

View Replies!   View Related
Cell (Address ... )
I have created the below formula to return an address. I need to use this address in the second formula ("cell address here"), If i am completely off base please point me in the right direction..


=OFFSET("Cell Address here",10-$BI$1,0,1,1)

View Replies!   View Related
Getting A Last Cell But One Address
how to Get a last cell but one only address

View Replies!   View Related
Address Of A Cell?
I have a variable Num that covers the range of C5, C6, and C7. I would like to figure out how to write the code that grabs just the column portion of say C5.

Set Num = Range(Range("C5"), Range("C5").End(xlDown))
Something like,

Range(Column(Num), 3).Value or something like that

View Replies!   View Related
Cell Address
regarding the cell value. What i am trying to do is I have alot of cells with datas and in cell(1,8) I have a data. I will search through these cells and if they match with data of cell(1,8), it will return me the cell (x,y) with x and y being the row and col numbers. Is there any command that I can continue with the below code to get the x and y?

For Each cell In Range(Cells(3, 4), Cells(500, 26)
If cell.value = cell(1, 8).value Then

View Replies!   View Related
Hyperlink & Cell Address
I'm so close to having this figured out, I use the formula =HYPERLINK("#Reps!"&ADDRESS(MATCH(9.99999999999999E+307,Reps!C:C),3)) for the hyperlink to the total I have for a PivotTable. But how do I get it to show the actual number as opposed to #Reps!$C$6489 in the hyperlinked cell? Any help would be great.

View Replies!   View Related
Finding The Address Of A Cell
I've got a spreadsheet where column A has dates and time and column C has over 8000 rows of numbers.

I'm looking to pull the date and time from column A associated with a value in column C...

how do i do a "lookup" in this case?

View Replies!   View Related
Find A Cell Address
I have the following macro written:

Sub GT()Dim cell As rangeDim BeforeNull As StringDim FirstNull As StringDim InitialData As StringDim B As VariantFor Each cell In range("A1:A8")Alpha:InitialData = cellFirstNull = InStr(1, InitialData, " ", vbTextCompare)If FirstNull = 1 ThenInitialData = Right(InitialData, Len(InitialData) - 1)cell = InitialDataGoTo AlphaEnd IfIf FirstNull "" And FirstNull "0" Then BeforeNull = Trim(Left(InitialData, FirstNull - 1))If FirstNull = "" Or FirstNull = "0" Then BeforeNull = InitialDatacell = BeforeNullNextEnd Sub

Now after the final Next, I need the macro to select the last cell changed. Is there a way to do this?

View Replies!   View Related
VBA: How Can I Use Relative Cell Address
way I can use relative cell address in VBA? For example, in the following table:

value item 1 apple item 2 peach item 3 mango
Instead of use

Range("B4").Value = "mango"

to insert mango to cell B4, I can use an address that's one row under peach, or one column to the right of item 3?

View Replies!   View Related
Returning The Address Of A Cell
i'm trying to figure out a way that would return the address of the cell that contains the highest/lowest value of a range i.e. =cell("address",min(g3:g6)).

if the lowest value was in cell g4, i'd want the output from above formula to be $g$4.

View Replies!   View Related
Copyright 2005-08, All rights reserved