Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default indirect macro

Is there a way to change cells that currently read
='week 1'!$a$17
to read
=indirect("'week1'!$A$17")
I have a few thousand cells to change each one referncing a different
cell...for instance Cell A18, Cell A19 etc...
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default indirect macro

For Each cell In selection
cell.Formula = "=INDIRECT(" & right(cell.formula,Len(cell.Formula)-1) &
")"
Next cell

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"ladyhawk" wrote in message
...
Is there a way to change cells that currently read
='week 1'!$a$17
to read
=indirect("'week1'!$A$17")
I have a few thousand cells to change each one referncing a different
cell...for instance Cell A18, Cell A19 etc...



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,624
Default indirect macro

See one response to your previous post in m.p.e.worksheet.functions

In article ,
"ladyhawk" wrote:

Is there a way to change cells that currently read
='week 1'!$a$17
to read
=indirect("'week1'!$A$17")
I have a few thousand cells to change each one referncing a different
cell...for instance Cell A18, Cell A19 etc...

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default indirect macro

I am getting a syntax error when I attempted to run this macro...any ideas?

"Bob Phillips" wrote:

For Each cell In selection
cell.Formula = "=INDIRECT(" & right(cell.formula,Len(cell.Formula)-1) &
")"
Next cell

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"ladyhawk" wrote in message
...
Is there a way to change cells that currently read
='week 1'!$a$17
to read
=indirect("'week1'!$A$17")
I have a few thousand cells to change each one referncing a different
cell...for instance Cell A18, Cell A19 etc...




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,494
Default indirect macro

probably word wrap, because it works fine.

Sub test()
For Each cell In Selection
cell.Formula = "=INDIRECT(" & Right(cell.Formula, Len(cell.Formula) - 1)
& _
")"
Next cell
End Sub

--


Gary


"ladyhawk" wrote in message
...
I am getting a syntax error when I attempted to run this macro...any ideas?

"Bob Phillips" wrote:

For Each cell In selection
cell.Formula = "=INDIRECT(" & right(cell.formula,Len(cell.Formula)-1)
&
")"
Next cell

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"ladyhawk" wrote in message
...
Is there a way to change cells that currently read
='week 1'!$a$17
to read
=indirect("'week1'!$A$17")
I have a few thousand cells to change each one referncing a different
cell...for instance Cell A18, Cell A19 etc...








  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default indirect macro

OK I tried to run it again...
this is what the formula in the cell ends up being:
=INDIRECT(" & Right(cell.Formula, Len(cell.Formula) - 1) & ")

I must be doing something wrong.....please help

"Gary Keramidas" wrote:

probably word wrap, because it works fine.

Sub test()
For Each cell In Selection
cell.Formula = "=INDIRECT(" & Right(cell.Formula, Len(cell.Formula) - 1)
& _
")"
Next cell
End Sub

--


Gary


"ladyhawk" wrote in message
...
I am getting a syntax error when I attempted to run this macro...any ideas?

"Bob Phillips" wrote:

For Each cell In selection
cell.Formula = "=INDIRECT(" & right(cell.formula,Len(cell.Formula)-1)
&
")"
Next cell

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"ladyhawk" wrote in message
...
Is there a way to change cells that currently read
='week 1'!$a$17
to read
=indirect("'week1'!$A$17")
I have a few thousand cells to change each one referncing a different
cell...for instance Cell A18, Cell A19 etc...






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
Macro-indirect cell puiuluipui Excel Discussion (Misc queries) 4 October 16th 09 07:59 PM
2Q:Indirect worksheet selection in macro, Calc off for specific sh seed Excel Discussion (Misc queries) 1 December 30th 08 09:11 PM
Using INDIRECT in a macro/vba gcouch Excel Discussion (Misc queries) 0 February 26th 08 09:37 PM
Macro that sort on clnm populated by indirect [email protected] Excel Discussion (Misc queries) 2 March 2nd 07 03:45 PM
Using Indirect & Creating a worksheet Macro Bill Healy Excel Worksheet Functions 1 November 5th 04 10:51 AM


All times are GMT +1. The time now is 03:58 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"