#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 40
Default Offset Prob

Hi

I am trying to name the variable name1 by an offset of
range a1 by a1 rows and 1 column.

But the following codes not working can anyone help me?

TIa

Sub TestName()

drp = Range("A1")
name1 = Worksheets("control").Range(drp).Offset(drp, 1)
MsgBox (name)

End Sub
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,236
Default Offset Prob

So if A1 = 1
and B2 = hello world
then it should display hello world

Sub TestName()
With Worksheets("control").Range("A1")
MsgBox .Offset(.Value, 1)
End With
End Sub


--
Rob van Gelder - http://www.vangelder.co.nz/excel


"Edgar" wrote in message
...
Hi

I am trying to name the variable name1 by an offset of
range a1 by a1 rows and 1 column.

But the following codes not working can anyone help me?

TIa

Sub TestName()

drp = Range("A1")
name1 = Worksheets("control").Range(drp).Offset(drp, 1)
MsgBox (name)

End Sub



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
CSE Formula Prob pdberger Excel Worksheet Functions 4 February 16th 08 03:51 AM
Compare Cell Values, Offset(-1,0), Offset(-1,-1), and xlFillDefaul RyGuy Excel Worksheet Functions 2 September 28th 07 10:54 PM
vlookup prob with all #n/a's Janis Excel Discussion (Misc queries) 5 July 30th 07 10:26 PM
Macro Prob Carl Excel Worksheet Functions 3 August 28th 06 05:03 PM
Still have formula prob :o( Libby Excel Programming 5 December 11th 03 05:26 PM


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

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"