Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2
Default Selecting Data on a Spreadsheet

I want to click on a cell in an Excel spreadsheet and then press a
control button that will perform an operation on that selected cell.
E.g. if my cursor is highlighting cell A4, I can press a button that
will do something with the data in A4. Is this a Worksheet_Change
function, or does someone have an easy solution for this? Thanks.

Ben

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,058
Default Selecting Data on a Spreadsheet

Make a button using the Forms Toolbar and then assign it to a macro like:

Sub bentar()
MsgBox (Selection.Address & Chr(10) & Selection.Value)
End Sub

--
Gary''s Student - gsnu2007


" wrote:

I want to click on a cell in an Excel spreadsheet and then press a
control button that will perform an operation on that selected cell.
E.g. if my cursor is highlighting cell A4, I can press a button that
will do something with the data in A4. Is this a Worksheet_Change
function, or does someone have an easy solution for this? Thanks.

Ben


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2
Default Selecting Data on a Spreadsheet

On Sep 14, 2:38 pm, Gary''s Student
wrote:
Make a button using the Forms Toolbar and then assign it to a macro like:

Sub bentar()
MsgBox (Selection.Address & Chr(10) & Selection.Value)
End Sub

--
Gary''s Student - gsnu2007



" wrote:
I want to click on a cell in an Excel spreadsheet and then press a
control button that will perform an operation on that selected cell.
E.g. if my cursor is highlighting cell A4, I can press a button that
will do something with the data in A4. Is this a Worksheet_Change
function, or does someone have an easy solution for this? Thanks.


Ben- Hide quoted text -


- Show quoted text -


Well, I actually figured it out and was using:

ActiveCell.Value

But I want to do a range check with the ActiveCell function, but it
isn't really working. I want to define a range on the worksheets. If
the active cell is not within that range, I'll display a MsgBox. I
thought this might work.

Public Sub Check()

Dim Range1 As Range: Dim Range2 As Range
Range1 = Worksheets("Sheet1").Range(ActiveCell, ActiveCell)
Range2 = Worksheets("Sheet1").Range("A1:M30")
If Not Application.Intersect(Range1, Range2) Then
MsgBox(...)
End If

End Sub

I don't get past the second line without getting a "Run-time error
'9': Subscript out of range" error. Any ideas?

Ben

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Pivot charts - data disappear after selecting or data are static Patricia Maklari Excel Worksheet Functions 0 July 24th 07 01:36 PM
selecting spreadsheet using tabs? Hoyos Excel Discussion (Misc queries) 0 December 1st 06 10:19 PM
Selecting All Rows with Certain Data Dave F Excel Discussion (Misc queries) 0 November 29th 06 07:24 PM
Selecting data cyc Excel Worksheet Functions 1 August 3rd 06 01:51 PM
The cursor on my Excel spreadsheet is not selecting cells. auberginewellies Excel Discussion (Misc queries) 2 March 20th 06 06:36 PM


All times are GMT +1. The time now is 01:01 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"