Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 07-28-2014, 04:51 AM
jamierbooth jamierbooth is offline Deleting info from specific table cells Windows XP Deleting info from specific table cells Office XP
Novice
Deleting info from specific table cells
 
Join Date: Feb 2011
Posts: 4
jamierbooth is on a distinguished road
Default Deleting info from specific table cells

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
To add a bit more:

- 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.
Reply With Quote
 



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 info from specific table cells Deleting A blank Line that has a specific heading style , word 2010 & 2013 SteveWcg Word 5 01-08-2014 10:37 PM
Deleting info from specific table cells Deleting rows with specific criteria joflow21 Excel 9 11-22-2013 12:10 PM
Deleting info from specific table cells Save table sytle, NOT a specific table Lebber Word 9 02-01-2013 12:31 AM
Deleting info from specific table cells how to transfer multiple excel cells into specific place in word document by formulas anton Excel 1 12-20-2011 03:56 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 09:53 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft