Go To Range On Cell Click
Dec 1, 2006
I have a spreadsheet with many worksheets in it. Sheet ' Names' has personal data for a person. Sheet 'Credits' has more information about that person's work.
When a cell in sheet 'Names' is clicked, the user is forwarded to cell containing the same name on sheet 'Credits'. I know how to do that with hyperlinks, but its not going to work becuase the list of names is updated.
1. How do I make the Sheet 'Names' react to clicking of the cell? Do I use procedure 'Worksheet_SelectionChange()'?
2. How do I switch sheets to highlight the cell on sheet 'Credits'?
3. How do I compare values in cells that are on 2 different sheets?
The code to highlight the cell is this, i think:
For x = 3 To <some number>
If Cells(x, 1).Value = <value of cell In sheet 'Names'> Then
Columns(x).EntireColumn.Activate
x=x+1000000
End If
Next x
I know this may seem trivial, but I am very new to VBA.
View 9 Replies
ADVERTISEMENT
Feb 3, 2009
Can you concatenate a range. I want to join 30+ cells together but dont want to click on every one?
View 10 Replies
View Related
Feb 6, 2008
I have a sheet where i have many differently named areas (like state1_1 and state1_2) When I doubleclick on a cell then a macro should run with following criteria: 1) Macro will run if the doubleclicked cell is part of any range in the list. Here I mean that names of ranges which belong to that list start with word state (like state1_1 and state1_2). No other ranges should not be in that list. If the cell is not in the range that is part of the list, then nothing should happen.
View 2 Replies
View Related
Feb 7, 2014
I want to run a macro any time any cell in a range is double clicked. I can make it work with just on cell, but not any cell in the range.
View 3 Replies
View Related
Feb 4, 2007
I've been reading through the forums, but do not know how to double click to get the calendar pop up,only in a certain range (e.g. Cells G5:G85).
I already have the module: frmCalendar
Running Office 2003
View 6 Replies
View Related
Oct 18, 2013
My goal would be to click on a cell within a range of cells (in a column) and have the value copied to a specified destination cell. There would be a few different columns with source cells and two destination cells. Each column would to copy to a specific cell. My ojective is basically to deal with different processing times (days, weeks, months).
Here's a little visual, clicking on C4 for example would copy the value "5" to cell B2. Clicking on D4 would copy "12" to A2.
row/col
A
B
C
D
E
1
Days
Weeks
Processing time X (weeks)
Processing time Y (in days)
Processing time Z (in weeks)
2
3
10
110
3
4
11
111
4
5
12
112
5
6
13
113
View 1 Replies
View Related
Feb 7, 2014
I wonder if it is possible to make a macro that right clicks a cell and then chooses a option from the list?
View 11 Replies
View Related
Apr 12, 2008
I want a macro I have made to run when I click in a particular range.
The macro I want to run is named: SortSizes
I want the macro to run when I click any cell in the range: A12:A4000
with some code and instructions to do this.
View 9 Replies
View Related
Jul 28, 2014
I have this list of all rangenames in my workbookin column A:A
For some reason I want to doubleclick on the rangename in the list to activate this range.
The reason is that I want more smooth activation-prosess; The Excel Range List is too long to practical use as a direct lookup, so I want to activate directly from my own list (where i have added definitions to the range names.
I have tried to build a hyperlink formula, but failed. Maybe the macro below can be modified to do the job, but I am stuck here as well.
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
Dim RangeName
Application.ScreenUpdating = False
If Target.Count > 1 Then Exit Sub
If Not Intersect(Target, Range("A:A")) Is Nothing Then
Cancel = True
[Code] ...........
View 2 Replies
View Related
Apr 12, 2008
I want a macro I have made to run when I click in a particular range.
The macro I want to run is named: SortSizes
I want the macro to run when I click any cell in the range: A12:A4000
View 9 Replies
View Related
Aug 31, 2009
I have a code for doubleclick on a cell and a gdt application chart will open.
Private Sub Worksheet_BeforeDoubleClicK(ByVal Target As Range, Cancel As Boolean)
ActiveSheet.Unprotect
ThisWorkbook.Unprotect
Dim i As Integer
Dim gdt As Long
Dim S As String
Cancel = True
With Application
If Target.Address(False, False) "C11" Then Exit Sub
'Place your direct path to open this GDT application
S = "C:Documents and SettingsUserMy DocumentsAndy's MachineINSPECTIONGDTGDT BitmapGD&T_Font.exe"
If Dir(S) = "" Then
MsgBox "File does not exist:" & vbCrLf & S, vbCritical, "Error"
Exit Sub
End If
gdt = Shell("""" & S & """", vbNormalFocus)
End With
ActiveSheet.Protect
ThisWorkbook.Protect
End Sub
What would the code be for a range of cells if doulbe clicked the range would be C11 thru C35
Also, I have a double click code for another symbol chart to open.
How, would this be used in the same manner if a coulmn or row were to apply on double click.
View 9 Replies
View Related
Jul 8, 2009
I am using a refEdit control on a userform to get a range from the user (they use the refEdit control to click on the desired range). My problem is that the user typically has 3 or 4 different workbooks open and if one of them is maximized withing Excel, the user is unable to get to them to select the range (only the maximized workbook is displayed and usable). Is there a way around this?
View 4 Replies
View Related
Jan 19, 2010
I am encountering is that with my knowledge I can only get one range to work on the worksheet_before doubleclick function and thats the sort range.
I need several different ranges with each range giving a target value uinique to that range.
View 6 Replies
View Related
Apr 4, 2014
I'm using Excel 2010 and when I highlight a range and right click 'name a range' is greyed out. I can bypass this by going to the formulas tab and defining a name from there.
Anything I can check to see why this is not an option for me?
View 3 Replies
View Related
Sep 28, 2007
I have customised the right click menu's for this spreadsheet and currently it is all hard coded. I was wondering if it is possible to dynamically modify the right click menu? The code currently has right click buttons for each staff member, and when clicked other actions are performed. I have added a "Staff" sheet and was wondering if there is a way the code can reference that sheet and create the list based on those entries for example, when new staff join or other staff leave?
I'm sure that there is a better way to go about this, perhaps a For... Next loop but I don't know enough about it. In the mean time, I will keep bashing away at it in hopes of a brainwave... it's a Friday before a long weekend and I think my brain has decided its holiday time.
Option Explicit
Private Sub Workbook_Deactivate()
On Error Resume Next
With Application
. CommandBars("Cell").Controls("Add Nick").Delete
.CommandBars("Cell").Controls("Add Toby").Delete
.CommandBars("Cell").Controls("Add Ben").Delete
.CommandBars("Cell").Controls("Add Matt").Delete
.CommandBars("Cell").Controls("Add Zoe").Delete
.CommandBars("Cell").Controls("Add Anne").Delete
.CommandBars("Cell").Controls("Add Craig").Delete
.CommandBars("Cell").Controls("Add Unknown (1)").Delete
.CommandBars("Cell").Controls("Add Unknown (2)").Delete
.CommandBars("Cell").Controls("Remove").Delete
End With
With Application
.CommandBars("Cell").Controls("Cut").Visible = True
.CommandBars("Cell").Controls("Copy").Visible = True...............................
View 2 Replies
View Related
Jul 20, 2006
I searched a few times for the answer to my problem, using different search terms, but I've come up somewhat empty (this *might* be because I'm not up-to- speed with Excel's terminology?). Anyway, my problem is this: I have a workbook which is designed to track various data for a corporate training course ( sheets for attendance, grades, tool logins, etc). After all of these are sheets numbered 1-25 (we never have more than 25 students in a class, but usually around 20). The numbered sheets correspond to the student's number in the on the class list sheet (so, the first student would have personal "report card" information on sheet 1; the eleventh student in the class list would have their information on sheet 11, etc).
What I would like to do is have some way of putting a button on the class list sheet which would look at student list and rename the sheets to correspond to the student names. For example, if the fifth student listed was 'John Doe', it would rename his personal sheet ('5') to 'John Doe'. Obviously, I would need to do it for all of the students, and IDEALLY it would then get rid of any numbered sheets which are not used (having 21 students would only rename the first 21 sheets, but then hide sheets 22, 23, 24, and 25).
View 9 Replies
View Related
Jan 23, 2014
what code I can put behind a button so that once I click on that button,
What ever cell i click on, the whole row of that cell will be colored a certain color.
Is this where i would used a target approach?
View 6 Replies
View Related
Jul 18, 2012
I am using a worksheet to scan or enter students into a school event and determine their eligibility to participate in the event. Everything is working great but I need to do the following on Enter Student button click:
1) Cut scanned value (ID number) from input Cell A1
2) Paste value into next empty cell in column A (Rows build as students are inputted)
3) Copy Eligibility status (text) from column F into A6
I have a limited VBA/Macro background and have NEVER got a button to work.
View 9 Replies
View Related
Nov 24, 2006
I have a worksheet dealing with customer order numbers in rows and various information about those orders in columns. The first 10 rows contain generic " header" type information with formulas to return certain values from the data below. Panes are frozen below row 10 so I can manually scroll down to see data. My "line numbers" (1,2,3,etc.) are listed in column "A", and begin on worksheet row 11.
The worksheet is set up so that when I enter a customer order number in cell "F2", my line number (Excel row + 10) is returned in cell "L2". I would like to use a Macro that would give the user the option (possibly with a button) to automatically scroll to the report line number returned in cell "L2".
View 3 Replies
View Related
Jun 6, 2007
Any way to make it so that if a user clicks into any single cell in columns O to AH, it will populate the cell with an X?
So if user clicks on cell, populate with X.
View 9 Replies
View Related
Dec 18, 2008
Is there a way to set a cell so if you click it, an "X" will be in the cell and if you click it again it will clear? Specifically I am looking to do this in the "1st Trip" column on the attached. I was going to use a check box but the appear to small and it does seems as though in Excel 2003 the size can be adjusted?
View 11 Replies
View Related
Apr 24, 2012
Is there a better way to do the following:
Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Address = Range("b5").Address Then
Sheet1.Range("j5").Value = Target.Value
End If
If Target.Address = Range("c5").Address Then
Sheet1.Range("j5").Value = Target.Value
[Code] ........
View 6 Replies
View Related
May 21, 2012
I currently have
Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
If Target.Address = "$H$1:$K$1" Then
Call FINALIZED_BY_QC
End If
End Sub
In my sheet code. In a macro I have some code to unlock these cells
Code:
Range("$H$1:$K$1").Select
Selection.Locked = False
But the code is trying to select these cells and run the macro. At this point I just want to simply unlock the cells not select them...
View 9 Replies
View Related
Sep 9, 2012
I have been able to record a macro which changes the value of a cell, based on a hyperlink click.
However I am not able to make it work properly for my lack of VBA knowledge.
The issue is I want to click the hyperlink in the column "B", say "B2" which is some email say (abc@gmail.com). This should result in Cell C2 changing its value to "sent".
If I do not click B2 , then value of C2 remains blank.
The macro which I recorded looks like
Code:
Sub Macrotest1()
'
' Macrotest1 Macro
'
'
With Range("B2")
Range("B3").Select
Selection.Hyperlinks(1).Follow NewWindow:=False, AddHistory:=True
Range("C2").Select
[Code]...
Sample file is uploaded in this location
Download email addr1.xlsm from Sendspace.com - send big files the easy way
This works till cell B5 since I recorded it till there.
I am not able to write a code for looping the same till the end (say B1000). I don't want to write till B1000 the same piece of code, but would like to do a loop (For, With...end with)...but really don;t know how to go about the same.
View 5 Replies
View Related
Apr 5, 2007
how to highlight an entire row and column automatically when the cursor activates a cell in a spreadsheet?
I have a large spreadsheet and when I click on a cell I'd like the whole row to be highlighted so I can check that I'm editing in the correct row. I know that the ROW HEADER is highlighted but I'd like the entire row to be highlighted. I'd like this to be so for every cell on my spreadsheet.
View 9 Replies
View Related
Jan 14, 2008
i have macro that opens up a calendar and inserts a date. i'd like it to automatically run when a particular cell is clicked. i don't want it to run for all cells, just cells in a certain column.
View 9 Replies
View Related
Mar 28, 2008
Here is a selection of my data:
[data] ......
Now here's what I would like to achieve.
If I click or maybe double-click on a cell I would like the cell colour to change to lets say yellow. However, I would like all matching cells to change colour too.
So from my example above if I clicked on C13 "3 TIMER" then C13 would change to yellow as well as C14 - C17 - C18 - C19
View 9 Replies
View Related
Oct 14, 2008
i have this piece of
Private Sub Worksheet_FollowHyperlink(ByVal Target As Hyperlink)
If Target.Range.Address "$A$1" Then macro1
Exit Sub
End Sub
I want so when i click on cell A1 it will run macro1.
So far the click on the cell works, but it works with every single cell I click on. How to I get it to just work with cell A1 instead of everyone single cell I click on?
Also, there are about 30 different cells that will run different macros, how would I go about creating adding the code the one above without having to create separate sub worksheets?
View 9 Replies
View Related
Jul 10, 2009
How do I run code if I click on a cell in the workbook, like Cell A1 of Sheet1?
So far I just have...
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Stop
End Sub
View 9 Replies
View Related
Aug 18, 2008
Is there a way to make a cell that when you click it a calendar pops-up and you can click a date on that calendar to auto-fill in that cell?
View 9 Replies
View Related