ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Offset function with merged cells (https://www.excelbanter.com/excel-programming/287158-offset-function-merged-cells.html)

MacroDaddy

Offset function with merged cells
 
Hi,

I have 6 cells in a row. I have merged them in groups of 3, to form 2
largers cells. The cells a

H1 and K1

H1 is the merger of H1, I1, J1
K1 is the merger of K1, L1, N1

Now i want to use the Offset function to refer to K1 from H1.

I tried

Range("H1").offset(0,1)
and also
Range("H1").offset(0,3)

but both didn't get me to K1.

Its soemthing to do with Merged Cells and the Offset Function I think.

Any ideas?


---
Message posted from http://www.ExcelForum.com/


Rocky McKinley

Offset function with merged cells
 
This worked for me...

'THIS RETURNS THE VALUE IN K1 IF H1:J1 ARE MERGED
Sub Tester()
MsgBox Range("H1").Offset(0, 1).Value
Range("H1").Offset(0, 1).Select
End Sub


--
Regards,
Rocky McKinley


"MacroDaddy " wrote in message
...
Hi,

I have 6 cells in a row. I have merged them in groups of 3, to form 2
largers cells. The cells a

H1 and K1

H1 is the merger of H1, I1, J1
K1 is the merger of K1, L1, N1

Now i want to use the Offset function to refer to K1 from H1.

I tried

Range("H1").offset(0,1)
and also
Range("H1").offset(0,3)

but both didn't get me to K1.

Its soemthing to do with Merged Cells and the Offset Function I think.

Any ideas?


---
Message posted from http://www.ExcelForum.com/





All times are GMT +1. The time now is 08:50 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com