![]() |
|
#1
|
|||
|
|||
|
Hi world.... I'm having trouble getting some code to work. (obviously, or I wouldn't be writing this!) To try and de-clutter an already enormous form....
From a command button, a table is copied and pasted below the existing table and I also want to remove the contents of selected cells. I've cobbled together some code that copies and pastes, and found somewhere that tells me what code to use to delete cell contents, however this bit isn't working for me. Code is below, I've commented out the delete bit that isn't working. Code:
Private Sub cmdBookings_Click()
With ActiveDocument
.Tables(23).Range.Copy
.Range.Select
Selection.GoTo what:=wdGoToBookmark, Name:="AfterTable23"
Selection.MoveUp
Selection.Paste
Selection.GoTo what:=wdGoToBookmark, Name:="AfterTable23"
Selection.MoveUp
Selection.InsertBreak Type:=wdSectionBreakContinuous
'ActiveDocument.Tables(23).Cells(1, 2).Select
'Selection.Delete
End With
End Sub
- User completes form - this particular table (23) shows accommodation bookings. - User will need to come back to form to add further bookings. - User then would (when it works) click button to send old info to bottom in a new table and clear out the existing table for another booking. - User may need to add 3 or 4 accommodation bookings within same form. Any help would be great. Also I struggle to understand the .Cells(1, 2) bit. How does that address the particular cell. Row 1, column 2 ?? or am I barking up the wrong tree? Thanks!!!! Jamie. |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Populate Cells with info contained in other cells | EC37 | Excel Programming | 8 | 07-16-2014 10:55 AM |
Deleting A blank Line that has a specific heading style , word 2010 & 2013
|
SteveWcg | Word | 5 | 01-08-2014 10:37 PM |
Deleting rows with specific criteria
|
joflow21 | Excel | 9 | 11-22-2013 12:10 PM |
Save table sytle, NOT a specific table
|
Lebber | Word | 9 | 02-01-2013 12:31 AM |
how to transfer multiple excel cells into specific place in word document by formulas
|
anton | Excel | 1 | 12-20-2011 03:56 AM |