Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,090
Default Unknown address change

Excel 2002, WinXP
I have a simple 3 line code:

MsgBox j.Address 'A4, correct
j.Offset(, 3).Formula = "=E" & j.Row & "/C" & j.Row
MsgBox j.Address 'D4

"j" is a single cell range, A4. As you can see, "j" is set to D4 after the
formula is inserted into D4. Why? I expected "j" to stay A4.
Thanks for your help. Otto


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,441
Default Unknown address change

Otto,

No matter what I do, I get A4 for both msgboxes. Have you dimensioned your
variables properly?

Dim j As Range
Set j = Range("A4")
MsgBox j.Address 'A4, correct
j.Offset(, 3).Formula = "=E" & j.Row & "/C" & j.Row
MsgBox j.Address 'D4

HTH,
Bernie
MS Excel MVP

"Otto Moehrbach" wrote in message
...
Excel 2002, WinXP
I have a simple 3 line code:

MsgBox j.Address 'A4, correct
j.Offset(, 3).Formula = "=E" & j.Row & "/C" & j.Row
MsgBox j.Address 'D4

"j" is a single cell range, A4. As you can see, "j" is set to D4 after

the
formula is inserted into D4. Why? I expected "j" to stay A4.
Thanks for your help. Otto




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,090
Default Unknown address change

Bernie
Thanks for your response. Bob nailed it though. I had an event macro
that bit me. Otto
"Bernie Deitrick" <deitbe @ consumer dot org wrote in message
...
Otto,

No matter what I do, I get A4 for both msgboxes. Have you dimensioned
your
variables properly?

Dim j As Range
Set j = Range("A4")
MsgBox j.Address 'A4, correct
j.Offset(, 3).Formula = "=E" & j.Row & "/C" & j.Row
MsgBox j.Address 'D4

HTH,
Bernie
MS Excel MVP

"Otto Moehrbach" wrote in message
...
Excel 2002, WinXP
I have a simple 3 line code:

MsgBox j.Address 'A4, correct
j.Offset(, 3).Formula = "=E" & j.Row & "/C" & j.Row
MsgBox j.Address 'D4

"j" is a single cell range, A4. As you can see, "j" is set to D4 after

the
formula is inserted into D4. Why? I expected "j" to stay A4.
Thanks for your help. Otto






  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Unknown address change

Do you have any event code that could modify j?

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Otto Moehrbach" wrote in message
...
Excel 2002, WinXP
I have a simple 3 line code:

MsgBox j.Address 'A4, correct
j.Offset(, 3).Formula = "=E" & j.Row & "/C" & j.Row
MsgBox j.Address 'D4

"j" is a single cell range, A4. As you can see, "j" is set to D4 after

the
formula is inserted into D4. Why? I expected "j" to stay A4.
Thanks for your help. Otto




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,090
Default Unknown address change

Bob
You nailed it. I didn't think my event macros would do anything in this
case. After you said that, I looked again. I'm running out of hair.
Thanks again. Otto
"Bob Phillips" wrote in message
...
Do you have any event code that could modify j?

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Otto Moehrbach" wrote in message
...
Excel 2002, WinXP
I have a simple 3 line code:

MsgBox j.Address 'A4, correct
j.Offset(, 3).Formula = "=E" & j.Row & "/C" & j.Row
MsgBox j.Address 'D4

"j" is a single cell range, A4. As you can see, "j" is set to D4 after

the
formula is inserted into D4. Why? I expected "j" to stay A4.
Thanks for your help. Otto








  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Unknown address change

Otto,

It only occurred to me as I had some event code in my workbook that I tested
it on, and when I stepped through, it stepped into the event code -
light-bulb :-)

Bob


"Otto Moehrbach" wrote in message
...
Bob
You nailed it. I didn't think my event macros would do anything in

this
case. After you said that, I looked again. I'm running out of hair.
Thanks again. Otto
"Bob Phillips" wrote in message
...
Do you have any event code that could modify j?

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Otto Moehrbach" wrote in message
...
Excel 2002, WinXP
I have a simple 3 line code:

MsgBox j.Address 'A4, correct
j.Offset(, 3).Formula = "=E" & j.Row & "/C" & j.Row
MsgBox j.Address 'D4

"j" is a single cell range, A4. As you can see, "j" is set to D4 after

the
formula is inserted into D4. Why? I expected "j" to stay A4.
Thanks for your help. Otto








  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,090
Default Unknown address change

That was good fortune. Otto
"Bob Phillips" wrote in message
...
Otto,

It only occurred to me as I had some event code in my workbook that I
tested
it on, and when I stepped through, it stepped into the event code -
light-bulb :-)

Bob


"Otto Moehrbach" wrote in message
...
Bob
You nailed it. I didn't think my event macros would do anything in

this
case. After you said that, I looked again. I'm running out of hair.
Thanks again. Otto
"Bob Phillips" wrote in message
...
Do you have any event code that could modify j?

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Otto Moehrbach" wrote in message
...
Excel 2002, WinXP
I have a simple 3 line code:

MsgBox j.Address 'A4, correct
j.Offset(, 3).Formula = "=E" & j.Row & "/C" & j.Row
MsgBox j.Address 'D4

"j" is a single cell range, A4. As you can see, "j" is set to D4
after
the
formula is inserted into D4. Why? I expected "j" to stay A4.
Thanks for your help. Otto










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
change of cells address Darius Excel Discussion (Misc queries) 11 September 7th 09 04:46 PM
How Can I Globally change Address of Hyperlinks? Terry Excel Discussion (Misc queries) 1 August 12th 09 06:55 PM
My hyperlink address change? hyperlink New Users to Excel 1 June 12th 07 01:58 AM
How do I avoid excel change absolute address to relative address Miguel Excel Discussion (Misc queries) 3 May 10th 07 11:18 PM
Hyperlink change address LDBlanes Excel Discussion (Misc queries) 1 February 3rd 06 11:30 AM


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