Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Inputbox to pull cell location


Any idea what I am doing wrong he

Sub TestRangeValue()

Dim dValue As Range

Set dValue = Application.InputBox(prompt:="Enter Cell Reference to Ge
Color Value For", Type:=8)

ActiveCell.Value = "=TSColor(" & dValue & ")"


End Sub

TSColor is a function I created to pull the background color in numbe
format so it could be sorted by color. I am trying to get this to typ
the formula for them (kind of a teaching thing for new formulas) whe
they select the range to use. I am getting the value in the range
select and not the range itself. If I enter C7 into cell C7 this work
to put the formula in cell C8 but if they select C7 and it is blank i
returns '=TSColor()'

Thanks for any help

--
stvgarne
-----------------------------------------------------------------------
stvgarner's Profile: http://www.excelforum.com/member.php...fo&userid=2059
View this thread: http://www.excelforum.com/showthread.php?threadid=53346

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Inputbox to pull cell location

Try

Dim dValue As Range
On Error Resume Next
Set dValue = Application.InputBox( _
prompt:="Enter Cell Reference to GetColor Value For",
Type:=8)
On Error GoTo 0
If Not dValue Is Nothing Then
ActiveCell.Value = "=TSColor(" & dValue.Address & ")"
End If



--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"stvgarner"
wrote in
message
...

Any idea what I am doing wrong he

Sub TestRangeValue()

Dim dValue As Range

Set dValue = Application.InputBox(prompt:="Enter Cell Reference
to Get
Color Value For", Type:=8)

ActiveCell.Value = "=TSColor(" & dValue & ")"


End Sub

TSColor is a function I created to pull the background color in
number
format so it could be sorted by color. I am trying to get this
to type
the formula for them (kind of a teaching thing for new
formulas) when
they select the range to use. I am getting the value in the
range I
select and not the range itself. If I enter C7 into cell C7
this works
to put the formula in cell C8 but if they select C7 and it is
blank it
returns '=TSColor()'

Thanks for any help.


--
stvgarner
------------------------------------------------------------------------
stvgarner's Profile:
http://www.excelforum.com/member.php...o&userid=20599
View this thread:
http://www.excelforum.com/showthread...hreadid=533460



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Inputbox to pull cell location


That did it, Thanks!!!

Do you know if there is a way to make the range not be absolute (C7
instead of $C$7)? Not to worried about this part though.


--
stvgarner
------------------------------------------------------------------------
stvgarner's Profile: http://www.excelforum.com/member.php...o&userid=20599
View this thread: http://www.excelforum.com/showthread...hreadid=533460

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Inputbox to pull cell location

ActiveCell.Value = "=TSColor(" & dValue.Address & ")"
becomes
ActiveCell.Value = "=TSColor(" & dValue.Address(0,0) & ")"

stvgarner wrote:

That did it, Thanks!!!

Do you know if there is a way to make the range not be absolute (C7
instead of $C$7)? Not to worried about this part though.

--
stvgarner
------------------------------------------------------------------------
stvgarner's Profile: http://www.excelforum.com/member.php...o&userid=20599
View this thread: http://www.excelforum.com/showthread...hreadid=533460


--

Dave Peterson
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Inputbox to pull cell location


Well that looks easy enough.



Thanks!!


--
stvgarner
------------------------------------------------------------------------
stvgarner's Profile: http://www.excelforum.com/member.php...o&userid=20599
View this thread: http://www.excelforum.com/showthread...hreadid=533460



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
Auto pull 3 cells into 1 cell at different location? (Excel) Roady Excel Discussion (Misc queries) 1 May 20th 08 04:10 PM
inputBox if cell " ? BigDave[_9_] Excel Programming 2 June 10th 05 09:36 PM
InputBox: Display Cell Content not Cell Ref ? MAS Excel Programming 3 July 11th 04 11:38 PM
From Cell to InputBox Robin Clay[_3_] Excel Programming 1 December 10th 03 12:56 PM
placing a pull-down menu at a cell location automatically Ken Nysse Excel Programming 4 October 4th 03 06:51 PM


All times are GMT +1. The time now is 02:53 AM.

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

About Us

"It's about Microsoft Excel"