ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   VBA using "Cells(i,j) (https://www.excelbanter.com/excel-discussion-misc-queries/69699-vba-using-cells-i-j.html)

Jeff

VBA using "Cells(i,j)
 
Hi,

I was using the code

a = Cells(73,3).address

so this set
a = "C73"

How would I use something similiar to set a equal to an array

a = "C73:AA73"

Thanks for your help

Dnereb

VBA using "Cells(i,j)
 

You want to use Ranges:

Dim L as Long, M as Long, N as Long O as Long
Dim Rng as Range

L = 3
M = 3
N = 100
O = 100

set Rng = activesheet.Range(cells(L,M),cells(N,O))

now Rng contains a range of cells on your sheet.


--
Dnereb


------------------------------------------------------------------------
Dnereb's Profile: http://www.excelforum.com/member.php...o&userid=26182
View this thread: http://www.excelforum.com/showthread...hreadid=508743



All times are GMT +1. The time now is 04:22 AM.

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