ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Column REferencing is out of wack (https://www.excelbanter.com/excel-programming/320019-column-referencing-out-wack.html)

Jennifer

Column REferencing is out of wack
 
Whenever I run this code I can get ColREf to set itself (11) and then when I
do a mouseover I get the same value as part of the XlRng4 definition. But
when I run it I get a selection that is wrong. It keeps setting itself to
selecting Column 8 instead of Column 11.

Any ideas?

Dim ColREf as Integer
Dim Xlrng4 as Range
ColRef = xlApp.Rows(3).Find("1/1/2005").Column
Set xlRng4 = xlApp.Range(xlApp.Cells(4, ColRef), xlApp.Cells(zz, ColRef))

Dick Kusleika[_4_]

Column REferencing is out of wack
 
Jennifer

I didn't have any problems with it, but I don't see where you're selecting
anything. Is there more to the code that might be causing the problem?

--
Dick Kusleika
Excel MVP
Daily Dose of Excel
www.dicks-blog.com

Jennifer wrote:
Whenever I run this code I can get ColREf to set itself (11) and then
when I do a mouseover I get the same value as part of the XlRng4
definition. But when I run it I get a selection that is wrong. It
keeps setting itself to selecting Column 8 instead of Column 11.

Any ideas?

Dim ColREf as Integer
Dim Xlrng4 as Range
ColRef = xlApp.Rows(3).Find("1/1/2005").Column
Set xlRng4 = xlApp.Range(xlApp.Cells(4, ColRef), xlApp.Cells(zz,
ColRef))





All times are GMT +1. The time now is 08:38 PM.

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