#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 24
Default Pausing a macro

I am trying to develop a macro that deletes a row of data after pausing for
input.

I need a message that asks if they want to delete. If no, quit. If yes,
pause and ask for the cell at the start of the row to be selected.

Once selected, how is the macro re-activated?

If any column other than "A" is selected I need an error message.
If cell "A5" is selected I also need an error message.

I then need the macro to select the 9 cells to the right (in the same row)
of the one selected. This range is then deleted.

Alex.W


  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 179
Default Pausing a macro

Use the UserForm and RefEdit ****rol

"Alex.W" wrote:

I am trying to develop a macro that deletes a row of data after pausing for
input.

I need a message that asks if they want to delete. If no, quit. If yes,
pause and ask for the cell at the start of the row to be selected.

Once selected, how is the macro re-activated?

If any column other than "A" is selected I need an error message.
If cell "A5" is selected I also need an error message.

I then need the macro to select the 9 cells to the right (in the same row)
of the one selected. This range is then deleted.

Alex.W


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 468
Default Pausing a macro

The below code CLEARS THE CELL CONTENT VERSUS DELETING **Watch out**
Paste this into a standard module:

Sub Foo()
Dim celaddress As String
res = MsgBox("Do you wish to delete a row?", vbYesNo)
If res = vbNo Then Exit Sub
celaddress = Application.InputBox("Enter Cell address of the row to Delete",
Type:=2)
Application.Goto Reference:=Worksheets("Sheet1").Range(celaddress)
If ActiveCell.Column 1 Then
MsgBox "You must select a cell in Column A"
Exit Sub
End If
If ActiveCell.Address = "$A$5" Then
MsgBox "You cannot select cell A5"
Exit Sub
End If
ActiveCell.Offset(0, 1).Resize(1, 9).ClearContents '<< Clears Contents
Versus Deleting !!
End Sub

Write back, if problems encountered..

Jim May


"Alex.W" wrote:

I am trying to develop a macro that deletes a row of data after pausing for
input.

I need a message that asks if they want to delete. If no, quit. If yes,
pause and ask for the cell at the start of the row to be selected.

Once selected, how is the macro re-activated?

If any column other than "A" is selected I need an error message.
If cell "A5" is selected I also need an error message.

I then need the macro to select the 9 cells to the right (in the same row)
of the one selected. This range is then deleted.

Alex.W


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro Help Needed - Excel 2007 - Print Macro with Auto Sort Gavin Excel Worksheet Functions 0 May 17th 07 01:20 PM
Pausing Macro Patches New Users to Excel 2 March 28th 07 03:00 AM
Is there a way of pausing a macro Shazza Excel Discussion (Misc queries) 2 March 12th 07 10:59 PM
Pausing a Macro PaulW Excel Discussion (Misc queries) 0 May 30th 06 02:05 PM
Spreadsheet pausing,calculating cells,up2 100%,each input,why? Matticace Excel Discussion (Misc queries) 1 August 23rd 05 01:33 PM


All times are GMT +1. The time now is 07:33 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"