ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   deleting objects (https://www.excelbanter.com/excel-programming/332527-deleting-objects.html)

Larry Sartoris

deleting objects
 
I have a confusing question to ask. (Hopefully it won't be too confusing).

I have this picture made up of different lines (autoshapes). What I want to
do is, is use an inpubox and take info in. Depending on the info (just
numbers) I want to delete certain lines. And then I want to "replace" them
when I run the macro again.
(like a "reset"). I have this all down...

My problem is when I "replace" the line, I don't know how to delete that
line later. It'll have a different autoshape #. That's how I was keeping
track of the lines originally.

If I was a little too confusing let me know. I'll try and explain it
further. Thanks so much!

Tom Ogilvy

deleting objects
 
why not copy the shape, delete the lines, hide the original. to reset,
delete the copy, unhide the original.

--
Regards,
Tom Ogilvy

"Larry Sartoris" wrote in message
...
I have a confusing question to ask. (Hopefully it won't be too

confusing).

I have this picture made up of different lines (autoshapes). What I want

to
do is, is use an inpubox and take info in. Depending on the info (just
numbers) I want to delete certain lines. And then I want to "replace"

them
when I run the macro again.
(like a "reset"). I have this all down...

My problem is when I "replace" the line, I don't know how to delete that
line later. It'll have a different autoshape #. That's how I was keeping
track of the lines originally.

If I was a little too confusing let me know. I'll try and explain it
further. Thanks so much!




Larry Sartoris

deleting objects
 
only a few problems with that i think? I can't seem to select the hidden
original. I like your idea I might be able to work with that. I just get an
error when I try to select a hidden object:

Sub lines()
ActiveSheet.Shapes.Range(Array("AutoShape 42", "AutoShape 43",
"AutoShape 45", "AutoShape 46")).Select
Selection.Copy
Selection.Visible = False
ActiveSheet.Shapes.Range(Array("AutoShape 42", "AutoShape 43",
"AutoShape 45", "AutoShape 46")).Select
Selection.Visible = True
End Sub

"Tom Ogilvy" wrote:

why not copy the shape, delete the lines, hide the original. to reset,
delete the copy, unhide the original.

--
Regards,
Tom Ogilvy

"Larry Sartoris" wrote in message
...
I have a confusing question to ask. (Hopefully it won't be too

confusing).

I have this picture made up of different lines (autoshapes). What I want

to
do is, is use an inpubox and take info in. Depending on the info (just
numbers) I want to delete certain lines. And then I want to "replace"

them
when I run the macro again.
(like a "reset"). I have this all down...

My problem is when I "replace" the line, I don't know how to delete that
line later. It'll have a different autoshape #. That's how I was keeping
track of the lines originally.

If I was a little too confusing let me know. I'll try and explain it
further. Thanks so much!





Tom Ogilvy

deleting objects
 
OK, then why not just change the colorindex of the line to xlnone, then to
reset it, loop through all the lines and set the colorindex back.

--
Regards,
Tom Ogilvy


"Larry Sartoris" wrote in message
...
only a few problems with that i think? I can't seem to select the hidden
original. I like your idea I might be able to work with that. I just get

an
error when I try to select a hidden object:

Sub lines()
ActiveSheet.Shapes.Range(Array("AutoShape 42", "AutoShape 43",
"AutoShape 45", "AutoShape 46")).Select
Selection.Copy
Selection.Visible = False
ActiveSheet.Shapes.Range(Array("AutoShape 42", "AutoShape 43",
"AutoShape 45", "AutoShape 46")).Select
Selection.Visible = True
End Sub

"Tom Ogilvy" wrote:

why not copy the shape, delete the lines, hide the original. to reset,
delete the copy, unhide the original.

--
Regards,
Tom Ogilvy

"Larry Sartoris" wrote in

message
...
I have a confusing question to ask. (Hopefully it won't be too

confusing).

I have this picture made up of different lines (autoshapes). What I

want
to
do is, is use an inpubox and take info in. Depending on the info

(just
numbers) I want to delete certain lines. And then I want to "replace"

them
when I run the macro again.
(like a "reset"). I have this all down...

My problem is when I "replace" the line, I don't know how to delete

that
line later. It'll have a different autoshape #. That's how I was

keeping
track of the lines originally.

If I was a little too confusing let me know. I'll try and explain it
further. Thanks so much!








All times are GMT +1. The time now is 12:09 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com