ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   type missmatch on Selection.Offset (https://www.excelbanter.com/excel-programming/369373-type-missmatch-selection-offset.html)

webby2006[_7_]

type missmatch on Selection.Offset
 

Code:
--------------------
Sub DuplicateColumns(iOffset1 As Integer, iOffset2 As Integer)

Selection.Offset(iOffset1 & ", " & iOffset2).Select

End Sub
--------------------


Code:
--------------------
Call DuplicateColumns(0, 3)
--------------------


I am getting type missmatch. What is the correct data type should I be
passing as argument?

Thank you.


--
webby2006
------------------------------------------------------------------------
webby2006's Profile: http://www.excelforum.com/member.php...o&userid=36744
View this thread: http://www.excelforum.com/showthread...hreadid=568268


John[_88_]

type missmatch on Selection.Offset
 
Webby,

The comma isn't a string so you don't need quotes around it. So.....

Selection.Offset(iOffset1, iOffset2).Select

....will work.

Best regards

John


"webby2006" wrote
in message ...

Code:
--------------------
Sub DuplicateColumns(iOffset1 As Integer, iOffset2 As Integer)

Selection.Offset(iOffset1 & ", " & iOffset2).Select

End Sub
--------------------


Code:
--------------------
Call DuplicateColumns(0, 3)
--------------------


I am getting type missmatch. What is the correct data type should I be
passing as argument?

Thank you.


--
webby2006
------------------------------------------------------------------------
webby2006's Profile:
http://www.excelforum.com/member.php...o&userid=36744
View this thread: http://www.excelforum.com/showthread...hreadid=568268




webby2006[_8_]

type missmatch on Selection.Offset
 

John Wrote:
Webby,

The comma isn't a string so you don't need quotes around it. So.....

Selection.Offset(iOffset1, iOffset2).Select

....will work.

Best regards

John



John,
an insight info I cannot forget, thanks a million.
webby;

--
webby200
-----------------------------------------------------------------------
webby2006's Profile: http://www.excelforum.com/member.php...fo&userid=3674
View this thread: http://www.excelforum.com/showthread.php?threadid=56826



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

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