ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Reference Column by #? (https://www.excelbanter.com/excel-programming/371695-reference-column.html)

HotRod

Reference Column by #?
 
Can I reference a worksheet cell by # instead of A75 use (1, 75) or
something similar?

What is the format?

Worksheets("Sheet1").Range(1, 75).Value = ???



HotRod

Reference Column by #?
 
If finding it difficult to jump from Coulmn "Z" to "AA" when I need to.



HotRod

Reference Column by #?
 
Never mind I found

Worksheets("Sheet1").Cells(30, 30).Value =



MDW

Reference Column by #?
 
You're close:

Worksheets("Sheet1").Cells(1, 75).Value = blahblah

And you can use variables in place of the numbers.

C = 75
Worksheets("Sheet1").Cells(1, C).Value = blahblah
--
Hmm...they have the Internet on COMPUTERS now!


"HotRod" wrote:

Can I reference a worksheet cell by # instead of A75 use (1, 75) or
something similar?

What is the format?

Worksheets("Sheet1").Range(1, 75).Value = ???




MDW

Reference Column by #?
 
I don't understand what you mean? The code below works just fine for me:

Sub Test()

Dim objRG As Range

Set objRG = ActiveWorkbook.ActiveSheet.Cells(1, 35)
MsgBox objRG.Address
Set objRG = Nothing

End Sub

It get a message box of AI1.
--
Hmm...they have the Internet on COMPUTERS now!


"HotRod" wrote:

If finding it difficult to jump from Coulmn "Z" to "AA" when I need to.





All times are GMT +1. The time now is 06:49 PM.

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