Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 206
Default Substitute worksheet function

Hi All,

I would like to replace a part of the text in A3 by "" (empty)for the
value in A5. In short the substitute worksheetfunction ... it is
bugging!
Any reason why?


Sub d()
Dim naam As String

naam = Application.WorksheetFunction.Substitute(ws.Range( "A3").Value,
ws.Range("A5").Value, "")
MsgBox naam
End Sub
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,080
Default Substitute worksheet function

Could you define "it is bugging?"

--

Vasant

"SIGE" wrote in message
om...
Hi All,

I would like to replace a part of the text in A3 by "" (empty)for the
value in A5. In short the substitute worksheetfunction ... it is
bugging!
Any reason why?


Sub d()
Dim naam As String

naam = Application.WorksheetFunction.Substitute(ws.Range( "A3").Value,
ws.Range("A5").Value, "")
MsgBox naam
End Sub



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 206
Default Substitute worksheet function

Hi Vasant
Seems I bug in my for For Each-loop ...as underneath code works fine.
I should replace in all worksheets of the active workbook the string
(always on sheet1)in A5 with "" ...


Sub d()
Dim naam As String
Dim ws As Worksheets

'For Each ws In ActiveWindow.SelectedSheets

naam = Application.WorksheetFunction.Substitute(Worksheet s("Sheet1").Range("A3").Value,
Worksheets("Sheet1").Range("A5").Value, "")
MsgBox naam

'Next

End Sub


"Vasant Nanavati" <vasantn *AT* aol *DOT* com wrote in message ...
Could you define "it is bugging?"

--

Vasant

"SIGE" wrote in message
om...
Hi All,

I would like to replace a part of the text in A3 by "" (empty)for the
value in A5. In short the substitute worksheetfunction ... it is
bugging!
Any reason why?


Sub d()
Dim naam As String

naam = Application.WorksheetFunction.Substitute(ws.Range( "A3").Value,
ws.Range("A5").Value, "")
MsgBox naam
End Sub

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 206
Default Substitute worksheet function

Got what I wanted,
Cheers Sige

sub d()
Dim naam As String
Dim ws As Worksheet


For Each ws In ThisWorkbook.Worksheets
naam = Application.WorksheetFunction.Substitute(ws.Range( "A3").Value,
Worksheets(1).Range("A5").Value, "")
MsgBox naam
ws.Name = naam
Next ws


End Sub



(SIGE) wrote in message . com...
Hi All,

I would like to replace a part of the text in A3 by "" (empty)for the
value in A5. In short the substitute worksheetfunction ... it is
bugging!
Any reason why?


Sub d()
Dim naam As String

naam = Application.WorksheetFunction.Substitute(ws.Range( "A3").Value,
ws.Range("A5").Value, "")
MsgBox naam
End Sub

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
Substitute function momotaro Excel Discussion (Misc queries) 4 August 28th 09 04:22 AM
'Substitute' function with wildcards [email protected] Excel Discussion (Misc queries) 1 July 22nd 09 05:42 PM
Substitute Function Question #2 Krista Excel Discussion (Misc queries) 5 April 13th 07 07:54 PM
Substitute function [email protected] Excel Discussion (Misc queries) 1 January 29th 07 07:48 PM
Case function substitute Mariano Excel Discussion (Misc queries) 2 January 6th 06 04:15 PM


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