Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 196
Default Use string as cell location, need help

Hi Seth

Cells doesn't take a string argument (it takes row index/column index
ie numbers) hence your problem. You can use Range instead:

Dim Loc As String

For i = 3 To 29
Sheets("Sheet1").Select
TempLoc = Cells(8, i).Formula
Loc = Right(TempLoc, Len(TempLoc) - 8)
If Cells(10, i) = "N.G." Then
Sheets("Sheet2").Select
Range("Loc") = "N/A"
End If
Next


Richard


Seth wrote:
I am trying to use a truncated string as a new cell reference, but I am
getting a type mismatch error. Please help.
For this example, Loc becomes "$X$62" which was created from a cell which
contained the formula =Sheet2!$X$62

Dim Loc As String

For i = 3 To 29
Sheets("Sheet1").Select
TempLoc = Cells(8, i).Formula
Loc = Right(TempLoc, Len(TempLoc) - 8)
If Cells(10, i) = "N.G." Then
Sheets("Sheet2").Select
Cells("Loc") = "N/A"
End If
Next

Perhaps there is a way to get the cell reference directly from cell(8,i)?
Thanks for the help.


Reply
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
Use string value for database location - VBA [email protected] Excel Worksheet Functions 1 May 15th 09 01:06 PM
Excel: Use pic location string to call up picuture in cell? vloh28 Excel Discussion (Misc queries) 1 October 30th 07 12:42 AM
find a character location in a string starting from the right funtipoom Excel Worksheet Functions 2 February 15th 07 12:18 AM
join location string with variable excel programming[_2_] Excel Programming 0 August 28th 03 03:46 AM
join location string with variable igor Excel Programming 4 August 27th 03 02:46 AM


All times are GMT +1. The time now is 11:43 PM.

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"