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

hi all,
how do i make a reference to a single specific cell (for example D1)
in a amcro
thanks

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default singel cell reference

Hi Guye,

'-------------------
how do i make a reference to a single specific cell (for example D1)
in a amcro
'-------------------

I suspect that there may be more to your question than
is immediately apparent, but try something like:

'=============
Public Sub Tester()
Dim rng As Range

Set rng = Range("D1")
MsgBox rng.Address(0, 0)

End Sub
'<<=============


---
Regards,
Norman


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 63
Default singel cell reference

The default property for the range object is Value, so in most cases,
you can use Range("D1") directly
a = Range("D1") * 10
As you get deeper into VBA, you may hit cases where Range("D1").Value
is specifically needed.

Carl.

On Apr 16, 4:20 am, "Norman Jones"
wrote:
Hi Guye,

'-------------------
how do i make a reference to a single specific cell (for example D1)
in a amcro
'-------------------

I suspect that there may be more to your question than
is immediately apparent, but try something like:

'=============
Public Sub Tester()
Dim rng As Range

Set rng = Range("D1")
MsgBox rng.Address(0, 0)

End Sub
'<<=============

---
Regards,
Norman


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default singel cell reference

Hi Carl,

'---------------
The default property for the range object is Value, so in most cases,
you can use Range("D1") directly
a = Range("D1") * 10
As you get deeper into VBA, you may hit cases where Range("D1").Value
is specifically needed.
'---------------

I assume that your response was intended for Guye.

However, I would strongly advocate the required property be
stated explicitly, rather than relying on a default value.


---
Regards,
Norman


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
insert a paragraph break within text in a singel cell? Julie Excel Discussion (Misc queries) 4 April 5th 23 02:44 PM
Combined cells to a singel cell cwklep Excel Worksheet Functions 1 August 6th 09 12:07 PM
can you have 2 different colors in a singel cell? Erin P Excel Discussion (Misc queries) 2 June 6th 08 03:46 AM
matching 2 values with a singel value davegb Excel Programming 5 May 1st 06 08:44 PM
Mail a singel sheet i an xls file. Kirsten Excel Discussion (Misc queries) 1 June 8th 05 01:25 PM


All times are GMT +1. The time now is 08:24 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"