Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
How can I modify the macro below with input box code to replace "2008"
by "2009" using an input box more easily - (i.e an input message to input 2008 followed by an input message to input 2009 thxs Sub Replacetext() Dim ws As Worksheet Dim longstr As String Dim i As Long For Each ws In ActiveWindow.SelectedSheets For Each shp In ws.Shapes 'shp.Select If shp.Type = msoOLEControlObject Then If TypeOf shp.OLEFormat.Object.Object Is MSForms.TextBox Then If shp.Type = msoOLEControlObject Then If TypeOf shp.OLEFormat.Object.Object Is MSForms.TextBox Then shp.OLEFormat.Object.Object.Text = Application.Substitute(shp.OLEFormat.Object.Object .Text, "2008", "2009") End If End If End If ElseIf shp.Type = msoTextBox Then longstr = "" For i = 1 To shp.DrawingObject.Characters.Count Step 250 longstr = longstr & Application.Substitute(shp.DrawingObject.Caption, "2008", "2009") Next i For i = 1 To Len(longstr) Step 250 shp.DrawingObject.Characters(Start:=i, Length:=250).Text = Mid(longstr, i, 250) Next i End If Next shp Next ws End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Cell Color changes On Input even if new input matches default | Excel Programming | |||
How to input pictures automatically based on cell input? | Excel Worksheet Functions | |||
input in number form is being multiplied by 1000 when i input. | Excel Discussion (Misc queries) | |||
How do I add input data in the input ranges in drop down boxes. | Excel Discussion (Misc queries) | |||
CODE to select range based on User Input or Value of Input Field | Excel Programming |