Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,388
Default Macro to delete and replace a text box

I use a macro in a master file to populate sub-files with data. I would like
to delete an existing text box in the sub-files and replace it with a text
box from the master file. Is there a way to do this using a macro? Any
information is appreciated.

Thanks

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Macro to delete and replace a text box

What kind of textbox - from the drawing toolbar or the control toolbox
toolbar.

Why delete and add - why not just copy the text from one to the other?

--
Regards,
Tom Ogilvy

"Dave" wrote in message
...
I use a macro in a master file to populate sub-files with data. I would

like
to delete an existing text box in the sub-files and replace it with a text
box from the master file. Is there a way to do this using a macro? Any
information is appreciated.

Thanks



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,388
Default Macro to delete and replace a text box

It is a text box from the drawing toolbar. In the past, I tried to set-up
the macro to go in and delete the text but it did not work. I will try it
again.

Thanks

"Tom Ogilvy" wrote:

What kind of textbox - from the drawing toolbar or the control toolbox
toolbar.

Why delete and add - why not just copy the text from one to the other?

--
Regards,
Tom Ogilvy

"Dave" wrote in message
...
I use a macro in a master file to populate sub-files with data. I would

like
to delete an existing text box in the sub-files and replace it with a text
box from the master file. Is there a way to do this using a macro? Any
information is appreciated.

Thanks




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Macro to delete and replace a text box

Sub AAAC()
Dim wkbk1 As Workbook
Dim wkbk2 As Workbook
Set wkbk1 = Workbooks("Archive.xls")
Set wkbk2 = Workbooks("Book1")
wkbk2.Worksheets("Sheet1").TextBoxes.Delete
wkbk1.Worksheets("Sheet1").TextBoxes(1).Copy
Application.Goto wkbk2.Worksheets("Sheet1") _
.Range("B9")
wkbk2.Worksheets("Sheet1").Paste

End Sub

--
Regards,
Tom Ogilvy

"Dave" wrote in message
...
It is a text box from the drawing toolbar. In the past, I tried to set-up
the macro to go in and delete the text but it did not work. I will try it
again.

Thanks

"Tom Ogilvy" wrote:

What kind of textbox - from the drawing toolbar or the control toolbox
toolbar.

Why delete and add - why not just copy the text from one to the other?

--
Regards,
Tom Ogilvy

"Dave" wrote in message
...
I use a macro in a master file to populate sub-files with data. I

would
like
to delete an existing text box in the sub-files and replace it with a

text
box from the master file. Is there a way to do this using a macro?

Any
information is appreciated.

Thanks






  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,388
Default Macro to delete and replace a text box

Hi Tom

Sorry about the second reply, I am scattered all over the map. I need to
replace the single box with two new boxes. The box is from the drawing
toolbar.

Thanks
Dave

"Tom Ogilvy" wrote:

What kind of textbox - from the drawing toolbar or the control toolbox
toolbar.

Why delete and add - why not just copy the text from one to the other?

--
Regards,
Tom Ogilvy

"Dave" wrote in message
...
I use a macro in a master file to populate sub-files with data. I would

like
to delete an existing text box in the sub-files and replace it with a text
box from the master file. Is there a way to do this using a macro? Any
information is appreciated.

Thanks






  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default Macro to delete and replace a text box

If you want to figure out how staff works try the macrorecorder
and do the things you want to do with the Textboxes.
here an example :

sub macro1()
Application.CommandBars("Picture").Visible = True
Application.CommandBars("Drawing").Visible = True
ActiveSheet.Shapes.AddTextbox(msoTextOrientationHo rizontal, 44.25,
173.25, _
171#, 132.75).Select
Selection.Characters.Text = "Hallo Leute"
With Selection.Characters(Start:=1, Length:=11).Font
.Name = "Arial"
.FontStyle = "Standard"
.Size = 10
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = xlAutomatic
End With
Range("E22").Select
End Sub

The interesting part is The Shapes Collection of the WorkSheet that contains
several interesting things like Buttons, Graphics and so on.

Greetings Jonjo

"Dave" wrote:

Hi Tom

Sorry about the second reply, I am scattered all over the map. I need to
replace the single box with two new boxes. The box is from the drawing
toolbar.

Thanks
Dave

"Tom Ogilvy" wrote:

What kind of textbox - from the drawing toolbar or the control toolbox
toolbar.

Why delete and add - why not just copy the text from one to the other?

--
Regards,
Tom Ogilvy

"Dave" wrote in message
...
I use a macro in a master file to populate sub-files with data. I would

like
to delete an existing text box in the sub-files and replace it with a text
box from the master file. Is there a way to do this using a macro? Any
information is appreciated.

Thanks




  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default Macro to delete and replace a text box

If you want to know how that works for Controls on Sheets,
then try the excel macro recorder

Greeting Jonjo

"Dave" wrote:

I use a macro in a master file to populate sub-files with data. I would like
to delete an existing text box in the sub-files and replace it with a text
box from the master file. Is there a way to do this using a macro? Any
information is appreciated.

Thanks

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 to Replace/Delete Text Using "Watchword" List? PBJ Excel Discussion (Misc queries) 10 June 29th 07 09:50 PM
How to Delete a Range in Closed Workbook (to Replace Delete Query) [email protected] Excel Discussion (Misc queries) 1 March 8th 06 10:10 AM
Creating a macro to find and replace text Louise Excel Worksheet Functions 10 June 8th 05 10:29 AM
Replace Number with Text using Macro Carter68 Excel Discussion (Misc queries) 3 April 19th 05 08:57 PM
Macro to delete and replace a text box Dave Excel Discussion (Misc queries) 0 February 24th 05 05:17 PM


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