![]() |
| If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|||||||
|
|
Thread Tools | Display Modes |
|
#11
|
|||
|
|||
|
Sorry.., I wasn't paying close enough attention when I was fitting the
post to avoid word wrap! Revise the code as follows... Sub EditHiddenWkb() Dim wks As Worksheet, wkb As Workbook Dim vAns As Variant, sMsg As String Set wkb = Workbooks("my.csv"): Set wks = wkb.Sheets(1) With wkb 'Get the position to insert a new row, 'and the label of the column to delete. sMsg = "Enter the row number position to insert the new row AND " _ & "the label of the column to delete, separated by a comma." _ & vbCrLf & vbCrLf & "Example: 2,B " vAns = InputBox(sMsg) If vAns = False Then Exit Sub '//user cancels 'Insert row and delete column vAns = Split(vAns, ",") With wks .Rows(vAns(0)).Insert shift:=xlDown: .Columns(vAns(1)).Delete End With 'wks 'Confirm success Windows(wkb.Name).Visible = True sMsg = "Do you want to save the changes to " & wkb.Name & " ?" vAns = MsgBox(sMsg, vbYesNo) Windows(wkb.Name).Visible = False If vAns = vbYes Then .Save Else .Saved = True End With 'wkb End Sub -- Garry Free usenet access at http://www.eternal-september.org ClassicVB Users Regroup! comp.lang.basic.visual.misc microsoft.public.vb.general.discussion |
| Ads |
|
#12
|
|||
|
|||
|
thanks Its behaving better (although still not optimised) 1 thing I am stuck at..... when data file sheet is copied then i goto close workbook and it still asks me do I want to save spreadsheet...... why? If Not xlWkb1 Is Nothing Then xlWkb1.Close savechanges:=False xlApp1.Quit End If |
|
#13
|
|||
|
|||
|
Tell Excel the file has been saved even though it has not been.
xlWkb1.Close Saved = True Gord On Wed, 27 Jun 2012 10:32:39 -0700 (PDT), Ggalla1779 > wrote: > >thanks > >Its behaving better (although still not optimised) > > >1 thing I am stuck at..... when data file sheet is copied then i goto close workbook and it still asks me do I want to save spreadsheet...... why? > >If Not xlWkb1 Is Nothing Then > xlWkb1.Close savechanges:=False > xlApp1.Quit > End If |
|
#14
|
|||
|
|||
|
thanks gord give that a go |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Workbook has [Group] at the end of teh file name when opened | belinda | Excel Programming | 1 | November 21st 08 01:12 PM |
| Workbook has [Group] at the end of teh file name when opened | MikeR-Oz | New Users to Excel | 2 | September 12th 08 12:55 PM |
| Keeping a workbook hidden when opened via VBA??? | Simon Lloyd[_585_] | Excel Programming | 3 | October 6th 04 03:21 PM |
| Keeping a workbook hidden when opened via VBA??? | Simon Lloyd[_586_] | Excel Programming | 0 | October 6th 04 03:16 PM |
| Is Workbook read-only because of file permission or because file is already opened? | balexis | Excel Programming | 0 | September 29th 04 02:29 PM |