Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 273
Default Making A Nacro To Change The Contents Of Many Cells

Greetings,

I need to add an If statement to about 100 cells in a row. The cells
contain links to another part of the sheet. Most of the source cells
have formula which produces a "0". I am trying to replace the "0"
with a "". the formula is simple:

=If([Linked Cell]<0,[Linked Cell],"")

Right now I have:

=+[Linked Cell]

I can change it with a series of keystrokes. I tried to make a macro
and that does not work. Macros used to be keystroke recorders, but
not any more. (Sigh)

Is there anyway to make this more automatic?

If there is a way, how many ways are there, anyone know?

TIA

-Minitman


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default Making A Nacro To Change The Contents Of Many Cells

You don't need a macro.
You just need to use the Find-Replace feature of Excel.

- Select the cells you want to process.
- From the Edit menu, choose Replace
- In the Find What box, enter <0
- In the Replace with box, enter <""
- Click Replace All

Regards,
Edwin Tam

http://www.vonixx.com


----- Minitman wrote: -----

Greetings,

I need to add an If statement to about 100 cells in a row. The cells
contain links to another part of the sheet. Most of the source cells
have formula which produces a "0". I am trying to replace the "0"
with a "". the formula is simple:

=If([Linked Cell]<0,[Linked Cell],"")

Right now I have:

=+[Linked Cell]

I can change it with a series of keystrokes. I tried to make a macro
and that does not work. Macros used to be keystroke recorders, but
not any more. (Sigh)

Is there anyway to make this more automatic?

If there is a way, how many ways are there, anyone know?

TIA

-Minitman



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 273
Default Making A Nacro To Change The Contents Of Many Cells

Hey Edwin,

I think you misread my question, The formu;aa that I have NOW is:

=+[Linked Cell] (the term [Linked Cell] is not the term in
the formula, it represents what is actually in each cell and what is
in each cell is different))

What I am trying to get to is:

=If([Linked Cell]<0,[Linked Cell],"")

As you can see, the only items that can be replace because they are in
every cell is the "=+" with "=If(", which is not nearly enough.

Thanks for the reply.

Anyone else want to weigh in on this one?

TIA

-Minitman



On Thu, 6 May 2004 18:41:05 -0700, Edwin Tam
wrote:

You don't need a macro.
You just need to use the Find-Replace feature of Excel.

- Select the cells you want to process.
- From the Edit menu, choose Replace
- In the Find What box, enter <0
- In the Replace with box, enter <""
- Click Replace All

Regards,
Edwin Tam

http://www.vonixx.com


----- Minitman wrote: -----

Greetings,

I need to add an If statement to about 100 cells in a row. The cells
contain links to another part of the sheet. Most of the source cells
have formula which produces a "0". I am trying to replace the "0"
with a "". the formula is simple:

=If([Linked Cell]<0,[Linked Cell],"")

Right now I have:

=+[Linked Cell]

I can change it with a series of keystrokes. I tried to make a macro
and that does not work. Macros used to be keystroke recorders, but
not any more. (Sigh)

Is there anyway to make this more automatic?

If there is a way, how many ways are there, anyone know?

TIA

-Minitman




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Making A Nacro To Change The Contents Of Many Cells

Try





Sub ff()

Dim c As Range
Dim sTxt As String

For Each c In Range("a1:a10")
If c.Value < "" Then
Stop
sTxt$ = Mid(c.Formula, 1)
sTxt$ = Mid(sTxt, 2)
c.Value = "=If(" & sTxt & "<0," & sTxt & ","""")"

End If
Next c

End Su

--
Message posted from http://www.ExcelForum.com

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 273
Default Making A Nacro To Change The Contents Of Many Cells

Hey Mudraker,

That is what I was looking for. With that I was able to finish the
conversion that was taking forever.

Thank you very much.

-Minitman


On Thu, 6 May 2004 23:06:19 -0500, mudraker
wrote:

Try





Sub ff()

Dim c As Range
Dim sTxt As String

For Each c In Range("a1:a10")
If c.Value < "" Then
Stop
sTxt$ = Mid(c.Formula, 1)
sTxt$ = Mid(sTxt, 2)
c.Value = "=If(" & sTxt & "<0," & sTxt & ","""")"

End If
Next c

End Sub


---
Message posted from http://www.ExcelForum.com/


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
making # + or - based on another cells contents adam Excel Discussion (Misc queries) 2 October 29th 07 09:11 PM
making copied cells change with change in original cell Jennifer Mcdermeit Excel Worksheet Functions 2 July 20th 06 04:58 PM
making cells change relative to each other? cant figure out help plz MMA Excel Discussion (Misc queries) 7 June 14th 06 12:49 AM
making cells change relative to each other? cant figure it out MMA Excel Worksheet Functions 1 June 13th 06 08:09 AM
making cells change relative to each other? MMA Excel Worksheet Functions 0 June 13th 06 05:18 AM


All times are GMT +1. The time now is 02:20 PM.

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

About Us

"It's about Microsoft Excel"