Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Problem with copying a button in VB
With VB I am trying to copy two columns, one of which has a button in it. I recorded the below into a module. Columns("J:K").Select Selection.Copy Columns("L:L").Select Selection.Insert Shift:=xlToRight ActiveSheet.Shapes("Button 6").Select Application.CutCopyMode = False Selection.Characters.Text = "test" With Selection.Characters(Start:=1, Length:=4).Font .Name = "Arial" .FontStyle = "Bold" .Size = 10 .Strikethrough = False .Superscript = False .Subscript = False .OutlineFont = False .Shadow = False .Underline = xlUnderlineStyleNone .ColorIndex = 5 End With Range("M25").Select Problem 1. I have several rows where columns B:J are merged. When I run the first line of code above, it actually selects B:J not J:K even though this worked during the record process. Is there a way of codeing this so I only select/copy columns J and K? Problem 2. Cell K19 contains a button, when it gets copied excel gives the button copy the same name as the button in K19. So again while this work in practice, when I rerun the code ActiveSheet.Shapes("Button 6").Select selects the button in K19 not my new button. This now prevents me renaming the new button and therefore any further reference to it. I presume there is a better way I can do this, but this has stumped me for now, any ideas? -- Trefor |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Copying problem | Excel Worksheet Functions | |||
prevent button from copying | Excel Programming | |||
Matching and copying problem | Excel Programming | |||
Copying a button with code into another workbook | Excel Discussion (Misc queries) | |||
Copying Problem | Excel Programming |