Excel Hangs And Freezes After Writing Simple If Statement

Nov 3, 2012

Background: The user makes a selection from a drop down box on the main sheet (sheet5, G12). The drop-down box is linked to *Sheet31.Pax_Nav*. If the drop-down box's linked cell value is less than 5, then do nothing (manual input required). If it is greater than 5, then the vlookup matches that number to a person in the database and returns their weight. The code will pull the required person's weight but then Excel will hang and freeze.

Private Sub Worksheet_Calculate()
On Error Resume Next
If Sheet31.Range("Pax_Nav") > 5 Then
Sheet5.Range("G12").Value = Application.WorksheetFunction.VLookup(Sheet31.Range("Pax_Nav").Value, Sheet31.Range("H17:L48"), 5, False)
Else
End If
End Sub

View 9 Replies


ADVERTISEMENT

Excel 2010 :: Freezes Or Hangs In The Middle Of Work?

May 24, 2013

I have an issue with the excel freeze in our organisation.

Our organisation works on Citrix and the office applications have been upgraded to 2010 very recently.We have both 2003 excel users and 2010 excel users.There is a user who has a problem working on excel 2010 the excel freezes.Excel 2010 works fine for some time and all at a sudden hangs,once its hung it freezes all the other applications.

The same file runs properly on the other 2010 systems.The Excel file which hangs are also not of huge in size.

I am unable to get to the rootcause of the issue why the excel freezes or hangs in the middle of the work getting to the root cause of the issue and an answer for the excel hanging.

View 3 Replies View Related

Macro Code Hangs/Freezes Adding Rows

Sep 15, 2006

I've managed to use some code I found to add a new row below the selected row, and duplicate all the forumlas of the source row. It worked fine dozens of times yesterday, but today it's decided not to work. It gets as far as creating the new row(s), but then just hangs & excel crashes before duplicating the formulas. I've even tried reverting to an earlier version, which also worked fine, but this crashes also!

Sub Add_New_Row()
' Unlock Worksheet
Worksheets("Sheet1").Unprotect Password:="*****"
Dim x As Long
ActiveCell.EntireRow.Select 'So you do not have to preselect entire row
If vRows = 0 Then
vRows = Application.InputBox(prompt:= _
"How many rows do you want to add?", Title:="Add Rows", _
Default:=1, Type:=1) 'Default for 1 row, type 1 is number
If vRows = False Then Exit Sub
End If
'if you just want to add cells and not entire rows
'then delete ".EntireRow" in the following line
Dim sht As Worksheet, shts() As String, i As Integer
Redim shts(1 To Worksheets.Application. ActiveWorkbook. _
Windows(1).SelectedSheets.Count)..................................

View 7 Replies View Related

Writing A Between Statement

Dec 15, 2006

I have a list of items in a pivot table where each item has a date. I want to see how many items occur for each month. I am trying to use the COUNTIF formula, but I'm having trouble figuring out how to write the criteria for the dates.

How do I write the criteria part to include the entire month?

View 9 Replies View Related

If Statement When Writing A Macro

Dec 10, 2008

I am trying to write an if statement in my macro. It is not returning what I want. Can anyone tell me where I have gone wrong.

Dim D As Variant
D = Sheets("Instructions").Range("n3").Value
If D = 1 Then
'range("n5).value
Else
'range("b3").value
End If

View 9 Replies View Related

Nested Loop Hangs Excel?

Jul 4, 2014

I have a problem with a nested loop in my macro as Excel hangs every time i run my script. I suspect it is because my sheets have too many elements.

I am doing a software localization, and I need to translate records in column A (english) to column X (slovenian) in the same row. With each new version of the software, the number of rows changes.

I already manually did one translation (44000 rows), and now i need to do a new version translation, so I want to use my old translation (because many if not most of the elements are the same) and insert values into the new excel file.

In the new file in sheet1 I have a full column A with english words and an empty C column with slovenian words that I need to fill.

Into sheet2 I copied the old english in column A and slovenian translation in column B.

On sheet 3 i created a button that when clicked, goes though each row in sheet1.columnA, compares it to sheet2.colimnA, and if there is a match, copies the value from sheet2.columnB into sheet1.columnC. So, this should fill most of the translations I need to do, and the rest I will do manually

I am quite new to VBA so this is what I came up with:

[Code]....

The number of rows is around 44000 in each sheet. How I could optimize or even completely avoid the nested loop, because each time i click the button I need to wait for almost an hour and then Excel hangs.

View 8 Replies View Related

Simple Nested IF Statement

Mar 7, 2014

I am trying to do a nested IF statement in which if Cell A has a number, display it. If Cell A = "", look in Cell B. If Cell B has a number, display it but if its "", then display Cell C.

I have the IF statement working for the first two pieces but don't know how to incorporate a third statement: =IF(A="",B,A)

This works - how do I get it to check Cell B and show Cell C if B is empty?

View 2 Replies View Related

Microsoft Word Hangs With Excel Launch Code

Apr 29, 2012

Consider this procedure to execute a MS Word mailmerge from within Excel:

Code:
Option Explicit
Dim objword As Object
Dim odoc As Object
Dim odoc2 As Object
Dim wdsendtonewdocument As Object
Dim mypath As String

Sub merge()

[Code] ........

The application hangs on the line in red. The file name (worksheets("Frontpage").Range("B15")) exists. It hangs with periodic dialogues "Microsoft Office is waiting for another application to complete an OLE action."

I end up having to go into task manager to close the word application before I can regain Excel control again.

View 9 Replies View Related

Writing To File May Require Special Print Statement Syntax

Jan 22, 2013

Code:
' write data to txt file
For j = 1 To 3
For k = 1 To 21
Print FNum, OPTOarray(j, k)
Next k
Next j

I am writing an Array to a text file but I keep getting an error that the Print statement requires a suitable object. I tried Debug but all this did was put the data into the immediate window and created a file that was empty.

"????.Print FNum, OPTOarray(j, k)".

The data in the immediate window is correct but when you open the text file with notepad there is nothing to be seen.

View 1 Replies View Related

InputBox Error :: Simple Statement

Jul 30, 2009

experienced coder (not VBA) and I'm having trouble with a simple statement. No idea why it was working before and moving it to it's own Sub screwed it all up.

Sub InitialMessage()
On Error GoTo BadEntry
SiteTotal = InputBox("Enter the number of approved sites *Must be an Integer > 0*")

BadEntry:
Entry = "Bad"
Msg = "An error occurred!" & vbNewLine
Msg = Msg & "Make sure you enter a valid value in all the prompted Message Boxes"
MsgBox Msg

View 9 Replies View Related

Probably Simple IF-Then Statement For Recipt And Inventory Correspondance

Mar 30, 2008

I'm a new user here and am relatively raw in excel, and today I decided to make a type of Point-Of-Sale Workbook. I'm sure it has been done, and there are probably simple templates other places, but I want to say that I've done it :P. Basically, ive created page 1 as a recipt-type page that I can print off for customers that is set to total and add-in taxes and fees and all that jazz. The page 2 is a complete inventory of my parts.

Now what I want to do is save myself a little time. I want to be able to enter an Item Number in one of the cells in page 1, and have it automatically fill in the cells for the Item and Item Cost.

So I'll probably need something like.. IF Cell b2 on Sheet1 (Item Number) = Any number from Sheet 2, C column (Item Numbers), then Cell b3 (Item) on sheet 1 = corresponding row and cell (Item) on sheet 2, and Cell b4 (Item Cost) on sheet1 = Corresponding row and cell (Item Cost). If not, then do nothing.

View 6 Replies View Related

Excel 2010 :: Freezes When Using Pull Function In INDEX / MATCH

Feb 14, 2014

I am using Excel 2010.

My objective is to pull specific values from an external file corresponding to the correct name and year of my choosing. The first way I thought would be best is to use an INDEX/MATCH function. The problem is the external files change names so I would need a method to easily change the source file name from one cell. I then stumbled across the INDIRECT function, but the INDIRECT function will only work when the source file is also opened. I then came across Harlan Grove's pull function which allows you to import data from closed excel files.

So, this is what my formula looks like: =INDEX(pull("'"&G12&"");MATCH(C15;pull("'"&G14&"");0);MATCH(D15;pull("'"&G16&"");0))

Cells G12,G14, and G16 contain the file paths for the ranges. C15 is name and D15 is year.

The problem I have though is that when I try to execute the function, Excel gets stuck. if the code cannot handle large amounts of data. I tested the code with a simple SUM function for a small range from an external file and it worked just fine.

This is the code I am using:

[Code] ...

View 3 Replies View Related

Excel 2010 :: UI Updating Freezes During Massive VB Macro Crunching

Nov 30, 2011

I have an intensive VB program I've written that the user kicks off by clicking a button. I update a particular cell near the button with progress numbers so they can see what's going on. (This calculation can take up to 10 minutes.)

Sometimes, though, the UI stops updating. I know the calculation is still running because it completes eventually.

I am guessing Excel is getting too many updates to its screen (i.e. that cell) to keep up with the calculation going on in another thread, so it just gives up on the updating.

Is there a way to force Excel to keep updating the screen? I'm willing to give up the 0.01% slowdown in exchange for continuing to see progress. I see no need for the VB calculation thread to hog out the screen updater.

Excel 2010 on Win XP Pro SP3

View 9 Replies View Related

Looping Macro Freezes Excel When Encountering Large Numbers Of Rows

Sep 15, 2009

We are attempting to use the macro below.

We believe that the problem is "memory related."

However, we can't find the correct workaround to the issue.

In Excel 2002, the behavior was for the macro to work great on small numbers of rows, but to just stop on large numbers of rows. After it stopped, the user would manually run the macro throughout the spreadsheet, by holding down Ctrl + N.

In Excel 2007, the behavior of the program is different, and Excel actually freezes up.

We've narrowed down the problem to be possibly "memory related."

However, we don't know the correct workaround for this.

For example, in the posting below (the referenced link) they suggest using "variant arrays" to address memory limitations type of issues ... but I'm not sure of how to implement those.

View 6 Replies View Related

Writing Data From Excel To PDF

Mar 9, 2012

I have been working with Excel, access and vba from 4 years. But never worked with PDF files along with vba.

Now I have a requirement to write data from excel to pdf. I know about using Acrobat distiller to create Post Script file and then converting into pdf files.

But I wanted to know if there is any way to write data directly into PDF from excel using VBA.

View 6 Replies View Related

Excel 2010 :: Writing Macro To Create Chart?

Feb 12, 2014

I have 6 columns. The 5th and 6th columns are the most important. The 5th contains a figure and the 6th contains a type.

Bascially I am trying to do a basic chart showing the following 2 things. A. Do a percentage chart of column 6 (service) but not of percentage of hoem many lines the product is in. Not based on percentage of how many times Apples are shown compared to other products. I need it to add up everything, then do a percentage of total amounts of oranges and total of for Apples from the figures on column 5. Also, if possible, the pie chart will even show teh actual total figure per product in each (or next to) each pie chart slice.

know the easiest way to do this (step by step) in Excel 2010 and then I can perhaps write a macro for the future?

View 1 Replies View Related

Direct Writing To Excel Cell From External Application

Jul 20, 2012

How I can directly write info from an external application to an Excel sheet

Actually, I'm using a special dll collection to do it, but I would need to buy the 64 version soon. Problem is I use only one function of the entire collection so I want to look on how to create it my self. Basically, it took data from my charting software and write directly to my Excel Worksheet.Cell

View 3 Replies View Related

Excel Form Writing Filled Data To Another File Or Sheet

Mar 5, 2014

Currently I work on a file which will be more like a form which will be filled by user and after he or she hits the button, the filled data will be written or sent to another Excel file or even Sheet in the same workbook which will store the filled data in database like form. The same as some web form which will post the data to database.

In other words, the workbook contains to sheets, one with forms to be filled in (cells) and one with specified columns. After filling in the cells on the first sheet and hitting the button, it will trigger the macro which will send data to second sheet and post data from each cell to appropriate column.

View 7 Replies View Related

Writing Macro To Grab All Data From Word And Just Paste In Excel

May 8, 2014

I need in XL for a macro to run, open my word file, copy the entire thing and then paste it back in XL.

So leaving it general, Word.doc and Excel.xlsx

It's all because my company's POS system will only export to Word but everything we do is in XL.

View 6 Replies View Related

Can't Find Simple Excel Functionality

Nov 8, 2012

I'm looking for the functionality in Excel where you can unhide/hide a group of columns or rows by clicking the plus or minus sign below the ribbon but above the spreadsheet itself. I forget how to do it, but it basically groups the columns together and hides or unhides all of them with one click.

View 3 Replies View Related

Create A Simple Dash Board Using Only Excel?

Dec 17, 2013

I am trying to create a simple dash board using only Excel and no VBA. What I am trying to do is I want to create dependent drop downs and link up drops downs that will pull out the required data individually or with combination of those two. For example, let's say

A column has Dates of transaction,

B column has Item name

C column has Units

D column has Month name

E column has Shifts (Morning or Evening)

I am trying to make a dash board that will pull total Sum of individual items based on

Only Date wise
Datewise + shift wise
Month wise
monthwise + shift wise

I managed to create drop down list for dates, months, and shifts but i dont know the way how to link the individual drop down lists together to pull the data based on the selection. which function i should use here and how?

View 5 Replies View Related

Excel Simple File Path Check?

Jul 5, 2014

how I could perform a simple file path check using excel.

For example:

File Path
Exists

C:ImagesMatrix.png
Yes

C:ImagesCubic.png
No

View 5 Replies View Related

Excel 2010 :: Getting Simple Macro For Paste Value

Oct 21, 2012

Need a simple macro for paste value - it used to work in Excel 2003 but not 2010.

View 1 Replies View Related

Excel 2003 :: Conditional Formatting Not Working And Cannot Change Colour Of A Cell Or Writing?

Sep 23, 2013

Excel 2003

On one of our computers at work, Excel is acting especially strange. The conditional formatting in Excel on one of our computers is not working. In addition, we cannot fill a cell with any color or change the color of the writing. We can click a color for the letters and type it in, but immediately after another cell is highlighted, the writing goes black again. When we try to highlight multiple cells with the cursor, the cells are black instead of the normal color. This happens to not just spreadsheets that are new, but existing spreadsheets on our shared drive from only this one computer as well. No other computers are affected this way. All other computers show the spreadsheets fine and do not have any functionality issues.

View 5 Replies View Related

How To Make Simple Card / Board Game In Excel

Jun 3, 2013

I am looking to copy a simple board game in Excel

Basically it would be a simple race. Containing 4 counters (blue, green, red and Yellow) and 10 squares each.

There would be 40 cards 10 blue, 10 green, 10 red and 10 yellow. Cards would be draw randomly and the counters move respectively. I would be thinking about starting with =RANDBETWEEN(1,10).

I have no knowledge of VBA/ macro but would welcome ideas with what formulas/ commands to use.

I have added some snapshots to show what I would be looking for.

[URL]

View 4 Replies View Related

For/next Hangs Up On Second Time Around

Jan 25, 2007

I have and issue within my For/Next loop. I'm simply gathering name and address data from columns in the workbook and printing them out (one at a time) onto a preprinted form letter. I use offsetts to move around the data row and get the appropriate items(address1, address2, city, etc). The first time through, it prints out. I'm then raising the row offset by 1 to get the second name and address data.
I'm using a static starting point on the data sheet but the second time through, I get a Runtime error 1004 at the point where it is supposed to select that starting point. Oddly, entering Debug I have done something which allows it to continue. It gets the second batch of data and prints properly. I have not been able to duplicate how that happened.

View 6 Replies View Related

Simple Excel Using MSQuery To Access Data In One Of Tabs And Allow Updates

Jul 1, 2014

I'm trying to create a simple Excel spreadsheet (not looking for Access or complex relational database stuff) to have the following:

A tab with data about a person : name, date of birth, join date, and a list of sessions they attend (eg. Monday Morning, Monday afternoon etc).

A different tab in the same sheet, or a form to select from that list of people, and allow changes to the information, and the ability to save it back to the data tab. Ability to add new people or delete people would be useful.

I am looking to create this as a basis for managing sessions, creating a register etc....

Any simple spreadsheet which I can use as a starting point, or to use as a reference in getting it established?

View 3 Replies View Related

Excel 2010 :: Creating A Simple Line Marker Graph?

Mar 2, 2014

I'd like to create a simple graph exactly like the one on the picture, but for the life of mehow to do this on Excel 2010.This is the data I have:

Seperation First target Second target
0 59.00% 0.00%
2 64.28% 40.62%
4 62.68% 48.99%
6 60.81% 65.83%
8 61.82% 70.21%

View 6 Replies View Related

Excel 2013 :: Simple Date Arithmetic - Circular Reference?

Aug 10, 2014

Here is a very simple workbook/sheet with some simple date arithmetic.

I keep getting the warning that there's a circular reference in C2.

Either I need to suppress the warning so vba loops can run or PREFERABLY I'd get rid of the "circular reference".

Run with Excel 2013.

View 14 Replies View Related

Excel 2010 :: Use One Set Statement To Set Second Statement?

Feb 14, 2012

I am attempting to use a previously Set variable as part of the next Set statement, pretty unsuccessfully at present.

My purpose is trying to look up

Code:
tb_SelJobID.Value

from a userform in Col Z then look across the row to Cols D,I,N,S & W (different types of work) to see if

Code:
TbSelYr.Value

matches the year selected then insert a formula in the row to the left. Then loop down to the FinalRow.

Currently my Set Found1 statement does not recognise my Found10 value. I know it will be my syntax as it always is. I have cut down the following code to display where the problem areas are, Found1 thru 5.

Code:

Sub CmdGo3_Click()
Dim Row As Range
Dim FinalRow As Long
Dim Found1, Found2, Found3, Found4, Found5, Found10 As Range
Application.ScreenUpdating = False

[code]....

Windows 7 with Excel 2010

View 9 Replies View Related







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