LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
SJW SJW is offline
external usenet poster
 
Posts: 5
Default Reference Cell # with variable

Need help with the code below.
If I substitute
CellContents = Worksheets("Data for Sim RT").[B100].Text
It works!

Sub TestCellVariable()
Dim CellContents As Variant '...Cell contents
Dim lngCellNum As Long '...Row number
Dim strCell As Variant

lngCellNum = 100

strCell = "B" & lngCellNum
CellContents = Worksheets("Data for Sim RT").[strCell].Text

MsgBox "zzz Cell Contents is " & CellContents

End Sub
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Using variable for cell reference bmurlidhar Excel Discussion (Misc queries) 3 July 17th 09 07:16 AM
Variable Cell Reference Stormy Excel Worksheet Functions 2 February 15th 09 04:00 PM
Variable Cell Reference Andrew Excel Discussion (Misc queries) 3 December 29th 06 03:35 PM
problem with cell reference in =sum(offset(cell reference,x,y,z,a)). Want cell ref to be variable. [email protected] Excel Worksheet Functions 2 December 11th 04 12:05 AM
Problem with =sum(offset(cell reference,w,x,y,z). I want cell reference to be variable [email protected] Excel Worksheet Functions 2 December 11th 04 12:00 AM


All times are GMT +1. The time now is 07:27 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"