# Regression Error - Non-Numeric Data / Contiguous And Complete Rows Or Columns

Apr 10, 2013

However I have a subject at uni that requires me to create a series of regression models, histograms, correlation matrices etc.

For part of the assignment, i have to run 4 regressions (one for men & one for women) with dependent variable as average wages, and independent as bfast 1,2,3 and dinner 1,2,3 (all of which are dummy variables) (0 for male and 1 for female).

The second two regressions are exactly the same, except average wages must be transformed into log which i have already done.

I dont know how to differentiate the regression models into male and female (if possible). We must also include residuals and residual plots.

I keep getting an error that says non-numeric data, the other says input range must be a contiguous reference.

## How To Highlight Rows Or Data If Data Repeat In Complete Row

May 28, 2012

How to highlight rows or data if data repeat in complete row.

## Excel - Parsing Numeric Data From Table Into Separate Columns

Nov 18, 2013

100% Bran Nabisco 70 130 10 5 6

AlI-Bran Kellogg 70 260 9 7 5

All-Bran w/Extra Fiber Kellogg 50 140 14 8 0

I am having trouble parsing the numeric data from the following table into separate columns. The five different numbers (ex. 70, 130,10,5,6 in the first row) represent nutritional info about the product. As you can see, the number length varies for the different categories. How to get these 5 numbers into their own columns using LEFT, RIGHT, MID, FIND, etc. functions.

## Linear Regression Over The First 5 Points In The Set Of Data On The Same Graph

Mar 2, 2009

I have a set of data. I know how to do linear regression over the whole set of data. How do I have another linear regression over the first 5 points in the set of data on the same graph ?? I am using Excel 2007

## Incorporating Data Analysis: Regression Into A Macro

Apr 10, 2009

I'm trying to write a macro that will analyze data from one spreadsheet and do a regression. The information I want to be output on the same sheet. I tried to use the record function, but I got an error. It said "Run-time error '1004': ATPVBAEN.XLA could not be found. The code read:

## Using VBA To Complete Text To Columns?

Jun 23, 2014

I have a file that i need to use for analysis but it is currently a text file, how can i use VBA to open it with excel and then complete text to columns, using a delimiter of a semi colon.

I have attached a sample of before & After.

## Copy Non-Contiguous Columns

Sep 5, 2007

how to reference an entire column only knowing the column numbers, not letters. The response below was given.

Range(Cells(1, 40), Cells(1, 44)).EntireColumn.Select

I have a similar situation, except that I use the FIND command to return a column number based on a string match.

X_Column = Sheets ("Sheet1").Range("A1:IV1").Find("X").Column
Y_Column = Sheets ("Sheet1").Range("A1:IV1").Find("Y").Column
Z_Column = Sheets ("Sheet1").Range("A1:IV1").Find("Z").Column

Because of this, I can recieve non-sequential column numbers, simply based on where "X", "Y" or "Z" are in the sheet, which can be anywhere. I would like to select X_Column, Y_Column, and Z_Column and copy/paste to another sheet, hopefully without having to loop. I have a feeling that an answer refering to Named Ranges is coming, but I'm very green on the subject.

## Number Of Columns In Non-Contiguous Range

Jun 9, 2008

Consider the following range (in my case a PivotTable):A1:E7

I create a Named Ranges that corresponds to column 1:3 and 6 from the range above. i.e : A1:C7,E1:E7

I need to find out the number of columns of my range, this is because it can change in the future, and I have an offset formula needing this information.

When i type =columns(MyNameRange) it returns #REF! as there are 2 areas in my Named Ranges. I am expecting 4.

I have written the a VBA User Defined Function that does the job, but I would like to know if there is no native solution to get this information.

Function TotColumns(rng As Range)
Dim Cols As Integer
For Each Ar In rng.Areas
Cols = Cols + Ar.Columns.Count
Next
TotColumns = Cols
End Function

## Sum Cells Which Meet Certain Values In Non-contiguous Columns

Jan 1, 2009

I'm trying to sum cells which meet certain values in non-contiguous columns. It's difficult to explain so I've attached a sample wookbook.

## Vba Autofilter Non-contiguous Rows

Nov 15, 2009

I have a workbook that is used for storing test results that relate to people in different groups.

B4, C4, D4 are the surname, first name and group headings. This is what I want to filter by.

Column E is empty

F,G,H,I,J,K are the results.

Column L is empty

M is total of results

What I want to do is set an autofilter from B-L, only have drop downs on B,C,D. But in addition to this I want to have it that the range can dynamically change if another column of results is inserted.

To calculate my formulas in the worksheet I named/defined M4 as 'Total' so that I could then offset from this named cell to determine the range of test result columns, which works well. I just don't know how to do this in vba.

I have this to just get the autofilter running:

With ActiveSheet
.AutoFilterMode = False
.Range("B4:L4").AutoFilter

End With

I need the range to be B4: offset of the cell 'total' 0,-1

and I need to loop through from F - offset of the cell 'total' 0,-1 and turn the dropdown off on each of these headers.

## Deleting Rows Is Slow To Run/Complete

Sep 1, 2006

I am working with about 50,000 rows of data and am trying to delete all of the rows where there is a zero in Column G. I tried to use an autofilter and copy the data to another worksheet but excel gives me an error message saying that it "cannot create or use the data range reference because it is too complex". If I use a loop to delete the rows, it takes upwards of ten minutes because of the amount of data.

## Manipulating On A Range Of Contiguous Rows Using VBA

Apr 13, 2008

I have a contiguous range of rows starting from row 5. ...It starts from row 5 but could end anywhere below.

The name of my Sheet is Tester.

Now in Tester, columns B,C, and D have numerical values in them. Using VBA, how can put in values in corresponding row of column A.

So if there are values from B1:D39 and B40 onwards is empty, then A1 will have value B1*C1*D1, then A2 will have B2*C2*D2 and so on until A39 = B39*C39*D39

**I need to write the code so the whole process is done fastest.The code may be long but the macro needs to run as fast as possible.

(Also, I remember using Screen.Updating = False when I wrote similar stuff many yrs ago. Would this be useful here?)

## Grouping Contiguous List Into Non-Contiguous Groups

Sep 9, 2006

I would like to be able to count the amount of entries in column C and depending on the amount group them in either groups of 3 or 4, all names would be unique...so if there are 14 names in the list they would need to be grouped in to two groups of 4 and two groups of 3, if there were 19 then 4 groups of 4 and 1 group of 3 etc to a maximum 50 people, the results could appearon a seperate worksheet say pasted on to the worksheet starting with the groups of 3 (so paste a group of 3 then skip 3 rows then paste groups of 4 skip 2 rows, the row skipping is to allow seperation and manual entry of extra data). There will never be groups of 5 or more and never less than 3

## Rows Contained In Non-Contiguous Named Range

Dec 1, 2012

I'm trying to write a 'ReImport' macro to copy data from one model into another. I'll call these models 'Master' and 'Split'. 'Master' contains about 50 departments' worth of financial data, and the 'Split' files contain a Division's (between 1 and 20 departments') worth of data. Structurally, the 'Split' files are just copies of the Master with the unneeded departments hidden. They are sent to various Divisions for completion, then the ReImport process takes data from the Split files and copies it back into the Master. Every Split File contains the full 50 departments from the Master, and it is only the 'Visible Row' distinction plus a 'ReImport key' that should determine what gets ReImported.

Each 'Split' range has a range name that controls what Departments are hidden or visible, but the range name is not contiguous. In other words, Division A might show Departments 1, 4-8 and 23. (Reordering the Depts is not an option.)

In a perfect world, I want to evaluate ONLY rows contained within the Division range name for the ReImport key. But the non-contiguous aspect of the named range is throwing me off. So in the above example, JUST Departments 1, 4-8 and 23.

My second-best solution would be to search through Departments 1-23, though that would be much slower...

## Proper Syntax To Delete Non-contiguous Rows

Nov 11, 2009

I am drawing a complete blank. If in a macro I have determined and built a string list of non-contiguous rows that need to be deleted (e.g. rows 3, 5, and 7) from a range of rows named "Prices", what would be the correct syntax?

For example, I know it isn't..

Prices("3:3", "5:5", "7:7").Rows.Delete
because this gives me a "Type Mismatch".

## Select Non Contiguous Blank Rows Via Array

Feb 17, 2008

I have a problem with the following code.

I want to select multiple rows in a very huge spreadsheet. But, when I
use this code, I receive an error: Runtime error 1004, Method ' Range'
of Object '_global' failed. What is wrong? Or maybe there is other
better way to select automatically empty rows in a spreadsheet?

Public Sub delhol()
'
' delhol Macro
'
' Keyboard Shortcut: Ctrl+d
'

Dim k As Variant
Dim rr As String

k = Array(34, 35, 38, 39, 40, 77, 133, 182, 207, 209, 225, 226, 295,
299, 300, 338, 394, 437, 468, 470, 480, 481, 560, _
591, 599, 655, 712, 729, 746, 755, 756, 852, 860, 962, 990, 1005,
1006, 1077, 1081, 1082, 1083, 1114, 1176, _
1217, 1252, 1260, 1261, 1338, 1342, 1343, 1344, 1375, 1381, 1437,

## Hide Blank Rows In Non Contiguous Range

May 15, 2008

How do you select certain ranges in the same column to filter? The ranges I need are "c36:c50" & "c54:c68" & "c72:c87" & "c91:c155" & "c158:c172" & "c176:c202" all filtering for blanks. I can not filter from c36:c202 because there are blanks in the missing rows and they have to stay.

## Excel 2007 :: (Cannot Complete Task With Available Resources) When Trying To Delete Rows

Jul 11, 2012

I have VBA code that attempts to delete an entire row from my worksheet:

Code:
Cells(3,1).Select
Selection.EntireRow.Delete

This works fine on small data sets, but on larger data sets it gives me the error message, "Excel cannot complete this task with available resources". This happens even when I try to do the deletion manually (without VBA code). Clearly, the code itself is not the problem.

My document has about 250,000 rows and 2,500 columns. While this is big, it is significantly smaller than Excel's documented limit of 1,048,576 rows and 16,384 columns.

I am using Excel 2007. My computer has 2GB of RAM but even when I try it on a computer which has 8GB of RAM it gives me the same error. If I "ClearContents" instead of "Delete" it works fine. For my purposes, however, deletion is entirely necessary.

## Resource Error Message "cannot Complete This Task With Available Resources" When Changing Charts Thru VBA

Apr 19, 2006

I have the following code for a sheet in my workbook that has 3 charts:

Private Sub Worksheet_Change(ByVal Target As Range)
Application.Calculation = xlCalculationManual
ActiveSheet.ChartObjects("RdteObs").Chart.SetSourceData ThisWorkbook.Names("GSumRdteObs").RefersToRange
ActiveSheet.ChartObjects("RdteWip").Chart.SetSourceData ThisWorkbook.Names("GSumRdteWip").RefersToRange
ActiveSheet.ChartObjects("RdteExp").Chart.SetSourceData ThisWorkbook.Names("GSumRdteExp").RefersToRange
Application.Calculation = xlCalculationAutomatic
End Sub

but whenever the sub runs, I get this error message: "Excel cannot complete this task with available resources. Choose less data or close other applications." Does anyone have an idea what's going on?

## Moving Data From Rows To Columns And Delete Repeated Rows

Apr 16, 2014

removing duplicate rows and move other data frm rows to columns.xlsx.

I am attaching a sample excel sheet showing what I need to do.In the first tab, I have a list that includes duplicate rows (first column only). I want to remove those duplicate rows but I don't want to lose the data in the following columns which can be unique or duplicates as well.

see the desired result tab in the sheet to get an idea of what I am looking for as the end result.

Keep in mind that the actual source file I am working with could have up to 50000 row, and the expected results could be around 2000 rows. So nothing can be done manually.

## Deleting Multiple Non Contiguous Rows From A TABLE Based On Selection In A Listbox?

Feb 6, 2013

I have two pieces of code that perform virtually identical functions on different sets of data.Basically, the code deletes rows of data based on a selection in a listbox. One code works perfect, the other has an issue.

The Issue:

When I select a single row for deletion, or multiple contiguous rows, everything works fine. It is when multiple Non-Contiguous rows are selected that the problem occurs. I get a "Delete Method of Range Class" error.

The data for the code that doesn't work is in a defined TABLE, the date for the code that does work isn't. So I assume this is where the problem lies.

I converted the data for the code that did not work from a table to a range, and everything works fine. However, I would really prefer that this data remain a table. There is consistently going to be rows added and deleted, and a table will take those adjustments into account, whereas a named range shrinks each time I delete a row, and doesn't grow as I add rows.Here is the code that works:

VB:
'Delete Selected Offers
Else
For r = 0 To ListBox1.ListCount - 1 [code].....

## Vlookup Error: "Please Enter Vaild Numeric Response'

Jul 10, 2009

I have been doing vlookups for ages and have never seen this error. The vlookup works in some columns but not in others.

## Move Rows Of Data From Several Columns But Not All Columns?

Dec 18, 2013

Column A is numbered 1 -100 successively Column B thru D contains data that goes with the assigned number in column A. I need to be able to move rows of data in column B through D to a different set of rows all at the same time (not one cell at a time) without disturbing the set numbers in column A. And with that, have all the other rows of data automatically adjust accordingly(not to be deleted or replaced).

## Count Non-blank, Non-numeric, Non-zero, Non-space, Non-error Text Cells (2007)

Jan 29, 2010

I know different variations of this question get asked all the time... but I can't find an answer that I'm sure will *always* do what I want.

I have a range of cells (A1:A10), and I want to count all the text entries of positive length. That is to say, I don't want to count:

blanks
numbers
zeros
spaces
errors

I'm sure I need to use the LEN function, but I can't quite figure out how.

this counting expression will be inserted in a SUMPRODUCT formula

## Subtotal Numeric Columns

Oct 25, 2006

I get delivered flat files of data sometimes with 10 columns of data, sometimes with 20 or more. It could be alpha or numeric

I want to programatically subtotal all the columns that hold numeric data, ignoring dates. I know that the subtotal will always be grouped by the first column, but then the numeric columns could be in any of the remaining 19 or so columns.

## Move Numeric Cells From X Columns

May 1, 2008

I have 2 large rows of data next to each other imported from a different programme. Some of the cells in these 2 rows consist of values, some consist of words. I only want to cut the cells with values in these rows and paste them in a new row, called TXid. I have written VB code that cuts all the data in the rows and pastes them onto the new row. Now I would like to cut only the values in the row. How do I select only the values in the cell?

Cells.Select
Cells.EntireColumn.AutoFit
Range("I1").Select
ActiveCell.FormulaR1C1 = "TXid"
Range("G3").Select
Do
If ActiveCell = IsNumber = True Then
Selection.Cut Selection.Offset(0, 2)
End If
ActiveCell.Offset(1, 0).Select
Loop Until ActiveCell = ""
Range("H3").Select
Do
If ActiveCell = Isnumber = True Then
Selection.Cut Selection.Offset(0, 1)
Loop Until ActiveCell = ""

The ActiveCell = Isnumber = true is not working the way I want it to.

## Data Validation Auto Complete?

Nov 29, 2006

I'm using a very long validation list for a drop down menu. Is there anyway to setup the drop down so that one could start typing and the list would immediately eliminate to less options?

For example, my list consists of 3000 plant names. Instead of scrolling down to choose a plant that begins with a letter P, is there anyway to start typing "P" in the cell and have the list pop up and jump down to entries that begin with "P"?

I know I've entered data with such a function but can't figure out how to set it up?

## Cycling Through Two Ranges To Complete Blank Data

Nov 23, 2011

Any way to cycle through two ranges and fill in blank cells. The worksheet has a "header"(A2:H2) that bascially determines how the rest of the sheet will be filled out. This header is subject to change if one of the headers is changes(see PLAN, and TRAN CODE in example).

PLANSSNDATEFUNDSRCTRAN CODEITEM CODEAMOUNT (CASH)56016999-99-9999FBLNK01699161.00022.00033.0060988999-99-9999fBLNK0150595.00026.00037.00

The SRC and AMOUNT(CASH) fields will always be complete. What I'm trying to do is cycle through AMOUNT(CASH) and if the field is not blank to then cycle through crng lookig for blank cells. If the cell is blank it should copy the cell above. This is where I'm headed but it will cycle through the same crng(A3:H3) every time.

Public sub Line_Check
Dim ccell As Excel.Range
Dim crng As Excel.Range
Dim hrng As Excel.Range
Dim hcell As Excel.Range

[Code] ........

## Data Validation List Auto Complete

Mar 21, 2008

I am using the same VBA that is discussed in several threads on the internet to create a combobox on top of underlying excel validation. The most relevant post I have found on this site is linked below, however I am told that it has expired and I can not reply to it so I started this new thread.

Data Validation Autocomplete Via Combobox Modification

The VBA code discussed in the above linked thread is working pretty well in my excel file which has MANY different fields being validated. However, there is a problem that I can not seem to get past. Specifically, the combobox is currently showing the validated data behind it, but will also allow IN-valid data to be entered. Is there a way to stop this and force only valid data to be used (i.e., is there a way to force a "re-validation" on exit from the combo box)?

## Transfer Partial Data To Complete List

Apr 18, 2008

I have two worksheets. Both worksheets have two columns. Worksheet 1 column A looks like this:

1
4
7
8

Worksheet 1 column B looks like this:

x
x
x
x...................

What I'm looking for is a way to find that in worksheet 2 in column B a 'x' appears behind 1,4,7 and 8.