Automatically Sort A Workbook On Opening And Delete Blank Rows?

Jul 4, 2013

I am trying to educate myself in the wonders of Excel (2003) and an struggling somewhat.I have a small project loosely based on a shops stock control and have attached a copy of the workbook -

The user normally only has access to columns B, C and E due to the others being locked and the sheet protected.I would like the sheet to be automatically sorted based on column E each time the workbook is opened.I then need to automatically delete a row once an item in column B has been removed (made blank)

View 3 Replies


ADVERTISEMENT

Automatically Run Macro On Opening Workbook

May 19, 2009

I have attached a spreadsheet with a simple macro. How do i make the macro automatically run when the file is opened.

View 2 Replies View Related

VBA / Macro Automatically Opening Different Workbook

Dec 1, 2011

I wrote code for a few macros in a "save as" or practice version of a spreadsheet. Once I got the bugs worked out on the practice book I pasted the code into the actual spreadsheet I want to use. The problem is that whenever I run one of the macros it opens the practice book that I was using when I wrote the code. There should be no need for this and I can't figure out why that's happening. The code doesn't mention any workbook by name so I don't know why it would want to open the practice book.

View 4 Replies View Related

Automatically Display 2 Sheets When Opening A Workbook

Apr 9, 2008

I am preparing a simple document for employees to use that requires viewing two sheets simultaneously.

To make it user friendly I would like, if possible, to save it so that when opening the file, the two sheets open side by side without the user having to open the new window and juggle with window sizes etc.

View 9 Replies View Related

Workbook Automatically Opens When Opening/Closing Any Other

Mar 14, 2008

I have a problem, where every time I close or open any workbook, Excel prompts me to "Enable or Disable Macros" in one particular workbook, wether I have tried to open it or not. In the said workbook, I have a macro that automatically updates a pivot table upon selecting the worksheet where the pivot table resides.

The code for it is as follows:

Sub UpdateIt()
Dim iP As Integer
Application.DisplayAlerts = False
For iP = 1 To ActiveSheet.PivotTables.Count
ActiveSheet.PivotTables(iP).RefreshTable
Next
Application.DisplayAlerts = True
End Sub

Private Sub Worksheet_Activate()
Call UpdateIt
End Sub

There is something in the code that calls UpdateIt any time a workbook is opened, closed or selected.

View 3 Replies View Related

Automatically Minimize The 2007 Ribbon On Opening A Particular Workbook

Feb 22, 2009

I would like to be able to automatically minimize the Excel 2007 ribbon on opening a particular workbook. My preference is to be able to apply that minimization to certain worksheets only, but if that's not possible then minimizing the ribbons on all sheets in the workbook will be ok.

Will I also need a BeforeClose code as well to reinstate the ribbon so that it is visible when opening subsequent workbooks?

View 5 Replies View Related

Blank Workbook Opening When File Opened

May 31, 2008

When I open a saved excel file I am having a problem with one workbook opening(a blank one), then the box saying that the program contains macros, and then the second actual workbook opening. I do not know what I changed somewhere alone the line, how to make just the one workbook I want (the second one) to open?

View 2 Replies View Related

Clearing Form Control Checkboxes Automatically On Opening Workbook

May 8, 2009

I'm developing a workbook containing 121 sheets. Sheet 1 is effectively an index, and uses 120 form control checkboxes to unhide and display the selected sheets individually.

The code I'm using for each checkbox is below and is in a module.

View 8 Replies View Related

Opening Saved File Also Opens Blank Workbook

May 3, 2013

When I open any saved Excel file the saved file opens along with a blank workbook titled "Book 1". How can I make it so when I open any saved Excel file it only opens the file I want and not a new workbook every time?

View 2 Replies View Related

Prompting User To Delete Worksheet When Opening Workbook

Jul 13, 2012

I am trying to have an operation run when opening the Workbook. The UserForm opens fine, but I get an error when the GoButton_Click sub runs. The error file is not very comprehensive.

The user is promoted to 'Delete' or 'Cancel' before the sheet is deleted. I do want to select 'Delete' for the user, but I'm not sure how to do this.

The error mentioned occurs after the user selects 'Delete'. The error is:

Run-time error '-2147417848 (80010108)':
Automation error

The object envoked has disconnected from its clients.

VB:

Option Explicit
Private Sub UserForm_Initialize()
Me.Choices.List = Array("Choice 1", "Choice 2")
End Sub
Private Sub GoButton_Click()
If Templates = "Choice 1" Then

[Code]....

View 5 Replies View Related

Every Column Of Workbook Sort Automatically?

Mar 6, 2014

This code sort data of every Column of workbook.

I want sort only range e.g (c10:c61) of sheet(10) correct this code :

[Code] .....

sample.xls

View 1 Replies View Related

Excel 2010 :: Automatically Sort And Removing Rows?

Dec 11, 2013

I have 5 worksheets that I currently have to add information to and cut/paste information from one to another. The initial information stays the same but I have to cut and paste it into one of the other worksheets based on wether or not we; need to decide on a job, are working on the job, lost the job, won the job or the job is complete.

I would like to create one master worksheet where the information can be entered with a drop down cell stating the status of the job (listed above). I created the master tab and linked the 5 subordinate tabs using an IF formula, but how can the subordinate tabs filter or sort the references and organize them on the top of the page rather than leaving a bunch of blank rows (because the info in these blank rows went to a different subordinate tab)? I want to enter the info in the master tab and simply change the pull down cell to change which subordinate tab the information shows up on. This should allow me to print the subordinate tabs as reports without having to manually cut and paste the info or filter it, correct?

View 5 Replies View Related

Insert Blank Rows, Sort And Highlight

Jul 31, 2009

I am trying to accomplish three things with the attached workbook. The first thing is the insert a blank row between the different part numbers, column "A" to make the sheet easier to read. The second thing is to highlight the data in light gray (A:E) leaving the blank row that was created empty. The third is to then sort the worksheet by data in column "A" to group like numbers together.

View 12 Replies View Related

Macro To Delete Rows And Sort

Sep 27, 2009

I have attached a worksheet to illustrate a "Before" (raw data) and "After" (desired results).

Each row contains data on a forex trade. The variables which must be assessed in each row are:

Currency Pair (e.g. GBP/USD).
Opening Time
Closing Time

What I need to do is delete many rows in the raw data because they reflect a condition I do not want in my analysis, which is having multiple open trades of a single currency pair during the same time period.

To perform my analysis I need to delete all trades (rows) which meet the above condition.

The worksheet provides examples, along with a rudimentary tool I've used to help me sort/delete rows manually.

Since I am looking at thousands of trades, a manual sort/delete is impractical. (my eyes don't like this kind of work!)

The rudimentary tool I've used in manual sorts/deletes is simply to have a column which returns a "1" if a trade opens before an older trade has closed. I do this by first sorting the data by (a) currency pair then (b) date opened. Then I must manually go through multiple iterations of deleting trades until there all of the "1's" have disappeared.

I'm hoping someone can show me a macro which might do this sorting/testing/deleting automatically, at least to the point where all I have to do is repeatedly press a "macro" button until there are no "1's"

View 8 Replies View Related

Sort Rows Based On Two Columns And Leave Blank Row Between Them

Jul 23, 2014

I am trying to create a macro that sorts rows based on value of 2 columns, but every time that a value changes in either of them to leave an empty row between them. Is that possible? In simple words i want to separate my rows with the empty row while sorting them out alphabetically based on two columns.

Please check my screen shots. Test 1 is my spreadsheet before the macro. Test 2 is how i need it to be after the macro. The two columns that i want it sorted out is First GDS then Rate.

View 6 Replies View Related

Delete Blank Rows (formula Not Deleting All Rows)

Sep 30, 2008

I have the following codes to delete all blank rows in column A

Dim lastrow As Long
lastrow = Sheet1.Range("A" & Rows.Count).End(xlUp).Row
MsgBox lastrow

With Sheet1
For t = 1 To lastrow
If Cells(t, 1) = "" Then
Rows(t).Delete
End If
Next t
End With

End Sub

Although it is working , it is not deleting all the blank rows at once, I have to keep pressing on the macro button running the macro several times, until all blank rows are completely deleted.

View 9 Replies View Related

Delete Blank Rows & Rows Below Meeting Condition

Jun 21, 2008

I have an imported report in a spreadsheet. It imports to three columns. I need to check each row in column A for three seperate criteria and delete the rows I don't need. I need to delete blank rows and check next row for page header info. Delete these and next rows to next blank cell. Check next row for page header and not delete if not page header. Several rows down will be a cell with 23 blank spaces before the word Reg: and sometimes other words past this but always this first. This row is to be kept. I looked at the FAQ's example of Deleting but I don't think it will work. I also need to put a key word in column A at a point where I want to stop. This report is a couple thousand rows long so a VBA procedure would really save time. I have a procedure I use to check for two zero's in two cells that hide these rows but I couldn't modify it to work on this report.

View 9 Replies View Related

Using VBA To Delete Rows Automatically

Aug 13, 2007

What I need VBA to do is scan the data in a certain column (in this case column I entitled "Type") and if it picks up a certain letter (either a "C" "D" or "K") in a range starting from row 2 then Delete the whole row and condense them so I am only left with the data that corresponds to letters "E" and "R"...

Does there exist a macro that can accomplish this for me; the alternative doesn't even bare thinking about as the range can be anything up to row 6k

I have tried looking on the Net and have seen example of similiar macros, alas I'm completely new to this and cannot adapt it to my needs.

View 9 Replies View Related

Automatically Delete Rows With Nothing In Them

Jul 7, 2004

I have a spreadsheet where I would like to automatically delete rows with nothing in them. Here is a typed up example:

BEFORE
Column A

row 1 99999
row 2
row 3 99999
row 4
row 5 99999

AFTER
Column A

row 1 99999
row 2 99999
row 3 99999
row 4
row 5

The spreadsheets I am dealing with have 100's of rows so it is difficult to search through the spreadsheet and delete the rows with nothing in them.

View 9 Replies View Related

Automatically Hide Blank Rows In Spreadsheet

Jan 22, 2008

I have a spreadsheet that is linked to another spreadsheet in a workbook. The information comes from an export of an access query into a template in excel that I am using just to store the values, then I link the values to the appropriate field in another sheet. I was wondering is there a way to programmatically hide blank rows in this sheet starting at a specific row of the page.

View 4 Replies View Related

Automatically Delete Rows That Contain A Certain Word

May 15, 2007

I can trying to let the user type a word in to cell A1 and then have Excel remove the rows that contain the word. But VBA below just seem to delete all nonblank rows?

sub delete2()
Range("a2:a200").Select
For Each cell In Selection
If cell.Value = A1 Then
cell.ClearContents
End If
Next cell
Range("a2:a200").Select
Selection.SpecialCells(xlCellTypeBlanks).EntireRow.Delete
end sub

how I can update this code?

View 9 Replies View Related

How To Delete About 86k Blank Rows

Jun 17, 2014

I have been trying to delete about 86k rows in my table in a worksheet. It has been over 5 hours now and it is still running to delete. any better solution? or how long do i need to wait for the system to finish its work?

View 1 Replies View Related

Only Delete Rows When Whole Row Is Blank

Jan 19, 2012

I have a real problem with a file I'm working on. It has invoice numbers in one column, followed by payment milestones. In the row underneath, there is an 'x' to mark if payment was made in a particular zone, e.g.:

6010136113221/06/201005/07/201022/07/201016/09/2010XXX6010136113313/07/201030/07/201013/08/201014/10/2010XXX

The problem is that there are two rows with data, a blank row, then another two rows with data. I have thousands of rows and need a quick-fix to delete the blanks.

View 1 Replies View Related

VBA To Delete Blank Rows

Feb 23, 2013

a VBA code to delete blank rows.

The current worksheet has data which is retrieved from other worksheets.

For example:

Current worksheet A1= Sheet1!A1
Current worksheet A10= Sheet2!A1
Current worksheet A20= Sheet13!A1

The range of this current worksheet is A1:F1287 and inbetween there are blank rows. The cells in the current worksheet are not technically blank, because each cell (A1:F1287) retrieves the information from the respective worksheet.

I would like to know of a VBA code to delete a whole blank row/-s (all columns of this row is blank) inbetween the range. Therefore, if there is a whole blank row, this row to be deleted and to go to the next row that shows information . In other words, instead of me manually searching and deleting whole empty rows; a VBA code for this task.

View 9 Replies View Related

Too Many Blank Rows To Delete

May 9, 2007

modified my code to have the data continue to the next row where it left off before jump to other sheets. The code below creates too many blank rows of all sheets (9213, 9316, 9501 and 9601).

After the code stops execute, I have to delete all the blank rows. This takes too long, approximately 5 minutes for each sheet...

View 9 Replies View Related

Delete Blank Rows ..

Apr 24, 2009

I am trying to write a macro that will check from 1 to 143 columns..and if all the columns are empty then it has to delete that entire line. Totals rows are over 35000. I am using excel 2007. I have written the below code. Could someone pl help me in enhancing this.. or a better way as this is taking about an hour to complete.

Sub Costa()
Dim i As Long
Dim j As Integer
j = 2
For i = 2 To 37735
loop1: For j = j To 143
If Cells(i, j) = "" Then
j = j + 1
GoTo loop1
Cells(i, j).EntireRow.Delete
Else
j = 2
GoTo loop3
End If
Next j
Cells(i, j).EntireRow.Delete
loop3: Next i
End Sub

View 9 Replies View Related

Delete Columns, Increment Alphanumeric Text, Insert Rows & Sort

Feb 18, 2008

I am having to write a vba code for a survey data captured code online.

I am attaching the code and the vba module that is suupose to do

following things

2) dELETES THE LAST 3 COLUMNS

3) Initial 6 letters from each cell (Q0001=) UPTO (Q00011=)

4)Inserts new row at top from Q1 TO Q11

5) Sorts data on Q6 (Faculty/Staff)

Before all this the i need to insert blank cells for questions that have not been answered and shift the cells right (condition 1) ....

View 9 Replies View Related

Automatically Delete Rows In Which No Data Exists

Jan 14, 2007

I have some code that works almost perfectly. I am trying to automatically delete rows in which no data exists in cells in a certain column.

the problem that I am having is that is seems to go into an infinite loop.

For example, if I delete row 5 and then iterate to the next row, row 5 becomes what used to be row 6 and now my code is on row 6...essentially skipping a row.

Here is an example data set (note that the set is for 20 rows):
1
3
6

15

36
37

here is the
Sub Macro2()

r = 20
Min = 1
Do While r >= Min
If Cells(r, 1) = "" Then
Cells(r, 1).EntireRow.Delete
Else
r = r - 1
End If
Loop

End Sub

View 9 Replies View Related

How To Detect Blank Rows And Then Delete

Apr 18, 2013

I need to detect blank rows and then delete them but for the formula not be be affected

In the example attached there are 4 components but i may only need to use 3 so row 4 would be blank

i need to find the blank rows and delete them and for the formula in cells G12:H14 to be update as necessary

at the moment if i delete the rows i get a REF# in place of the cell which has been deleted

i have tried this on a simple formula and when you delete a row the formula changes as required

View 5 Replies View Related

VBA Delete Blank Rows Within Range

Jun 23, 2014

I've got a code that generates some worksheets in a fairly large workbook. The code is run monthly and replaces the already existing worksheets.

The problem is that each newly generated worksheets contains more than 1 million rows, which means that the size of each worksheet is around 5MB.

I need a code which allows me to delete all blank rows starting with row 1000 in those worksheets.

View 14 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved