Shortening A Macro (evaluates The Range )

Mar 14, 2007

I need a macro that evaluates the range H66:GI66.

In that range the following variables could exist:

A3, A4, A5, B3, B4, B5, C3, C4, C5, D3, D4...all the way to I5 for a total of 27 different combinations.........

View 9 Replies


ADVERTISEMENT

Shortening Recorded Macro?

Jul 15, 2012

shortening the below recorded macro?

Code:
Sub Macro1()
'
' Macro1 Macro

[Code].....

View 3 Replies View Related

IF Formula Evaluates To Wrong Value

Jan 29, 2014

I have the following formula: IF(SELL_INVESTMENT = "YES" , 1,2) It returns not 1 or 2 but 0. The worksheet contains over 1000 cells. Trace Precedents verifies that the formula evaluates the correct cell and that it contains "yes". I created a very simple worksheet to test the formula and here it correctly returns 1.

View 2 Replies View Related

Return No Value If The Function Evaluates To An #REF

Feb 25, 2009

I am using an array formula like this in cells A2:H100 of a worksheet:

=INDEX('Source Data'!$A$2:$Q$5000,SMALL(IF(('Source Data'!$I$2:$I$5000>=$O$1)*('Source Data'!$I$2:$I$5000<=$P$1)*('Source Data'!$M$2:$M$5000>0),ROW('Source Data'!$A$2:$Q$5000)-ROW('Source Data'!$A$2)+1,ROW($Q$5000)+1),ROW()-1),1)

The function must be present in all 99 rows to accommodate potential data, but there is rarely enough data to populate the entire sheet, leaving #REF! errors in some cells. Putting aside that using this many array formulae is sloppy programming, how do I craft the function above to return no value if the function evaluates to an #REF! error?

View 4 Replies View Related

Only 1st Condition Of Multiple IF Conditions Evaluates Correctly?

Jan 23, 2014

I have 4 conditions in one formula, and only the first condition (when met) evaluates correctly. When the other conditions are met, I get a VALUE# error.

I want to concatenate 2 cells, based on whether there is an "a", "b", "c", or "d" in a particular cell. see example. Below is my formula:

=IF(FIND("a",A4),B4&$B$1,IF(FIND("b",A4),B4&$C$1,IF(FIND("c",A4),B4&$D$1,IF(FIND("d",A4),B4&$E$1,B4&$B$1))))

View 6 Replies View Related

Data Validation - Source Currently Evaluates To Error

Apr 28, 2014

I am currently creating a form to hold 2 drop down lists that change depending on the selection in the first one. I had never done this before and taught myself and got it to work minus one problem. As soon as I input the formula under the Data Validation the error: "The Source currently evaluates to an error. Do you want to continue?" pops up. Right now the formula works except for the last 6 options in my first drop down. When I select them nothing pops up in the 2nd drop down menu. I have double checked and triple checked that I have no spaces or anything in my LIST on worksheet 2 or any of the names are input correctly.

A7 is the first drop down - PROPOSED

B7 the second. - ITEM #

Lists and data to populate the lists are on worksheet 2 with the "List" at the bottom of worksheet 2...

View 1 Replies View Related

If Formula Evaluates To True When Condition Is False

Nov 1, 2006

In E5, put "INSERT". In G5, put the formula

=E5="INSERT"

Should I be getting TRUE as the result? I'm getting FALSE. Is something wrong or am I going mad...

View 2 Replies View Related

Conditional Formatting Formula That Evaluates Values In A Row Of Cells

Apr 23, 2012

I need conditional formatting formula that evaluates the values in a row of cells (7 total columns) and counts the number of entries that are 30 or greater. If there are at least three, then I need to apply formatting.

I just can't get the formula right:

Code:
=(COUNTIF(B7:H7,

View 2 Replies View Related

Shortening A URL

Jun 1, 2007

I have a very long column (almost 3000 cells) of URLs. I would like to replace them in the second column with shortened versions, basically cut them at the fourth slash.

how can I used functions in Excel to do it?

View 10 Replies View Related

Shortening Text With MID

Apr 2, 2008

I'm using this function to make a short description of a product from a long description.

=MID(K2,1,200)&"…"

So it's taking the first 200 characters of cell K2 and adding a ... to it.

Whats happening is it is splitting words and ending at character 200 instead of the end of the closest word to character 200.

Is there a way to alter this formula to break at the end of a word close to character 200?

Or is there a better way to do this?

View 9 Replies View Related

Shortening Code

Mar 20, 2008

How would I make the following code shorter/ more efficient? The columns don't vary much - either B, G or L. The rows vary a bit more....

View 9 Replies View Related

Shortening Summation Formula?

Jan 10, 2014

I have attached a screen shot below of a sheet I am using to collate fruit orders and calculate an order total for each individual person.

Untitled.png

The price of each fruit item runs along row 3 and then each persons order has its own row. The total price for each person is then calculated in column AM. However I am looking to shorten the formula I am using to calculate the total in this column.

I am currently using:

AM4=SUM(C3*C4+D3*D4+E3*E5+F3*F5+........+AJ3*AJ5+AK3*AK5+AL3*AL5)
AM5=SUM(C3*C5+D3*D5+E3*E5+F3*F5+........+AJ3*AJ5+AK3*AK5+AL3*AL5)

As you can see this formula is far too long so I am looking to write it in compressed formula.

View 4 Replies View Related

Shortening Data For Printout

Feb 9, 2014

I have a letter and numbers in the A column. example: (A001_C108_1231Xb)

This kind of numbers go from Column A1 : A1800.

I need to print them out, therefore I would like to fill every page which has 50 rows and 3 columns : A, D and G to write in the data.

I tried to do it manually, which is quite some work.

View 5 Replies View Related

Shortening A Speed Sheet

Apr 18, 2008

weekly i have a report that is generated that is over 5000 lines and 4 columns wide.

I currently copy and paste one page column to make it 16 columns across the page. Is there a function in excel to do this?

View 9 Replies View Related

Shortening Code With Loop

Jan 16, 2007

How would I shorten this code using a loop and arrays? It is working correctly but needs to be shortened down.

Sub cr()
Dim j
Cells(1, 1).Interior.Color = RGB(250, 155, 100)
j = 0.09
Cells(1, 1).Value = j
Application.Wait Now + TimeValue("00:00:02")
j = 0.094
Cells(1, 1).Value = j
Application.Wait Now + TimeValue("00:00:02")
j = 0.043
Cells(1, 1).Value = j
Application.Wait Now + TimeValue("00:00:02")
j = 0.05
Cells(1, 1).Value = j
Application.Wait Now + TimeValue("00:00:02")
j = 0.034
Cells(1, 1).Value = j
Application.Wait Now + TimeValue("00:00:02")
j = 0.032.........................................

View 4 Replies View Related

Shortening Code To Copy Several Values

Jan 17, 2007

I have put together some code which works fine but is very clumsy and, when it comes to expanding it in the very near future, will look really bad.

rn = Worksheets("Test"). Range("C1").End(xlDown).Offset(1, 0).Row
Worksheets("Test").Range("C" & rn) = Odate 'a variable already created
Worksheets("Test").Range("D" & rn) = Range("E8")
Worksheets("Test").Range("I" & rn) = Range("E4")
Worksheets("Test").Range("K" & rn) = Range("D6")

Is there a s way to simplify this code (and the several more lines of similar) using For..Next and/or With function(s)? I've tried a few combinations but can't quite strike the right one.

View 2 Replies View Related

Combining 2 Vba's And Shortening The Processing Time

Jan 24, 2007

I have created 2 seperate VBA's that I would like to combine and improve upon. One removes Duffs, and the other eliminates blank rows. My goal is to do a copy and paste/special, then remove the duffs, and then delete all rows that do not have data in column H.

I have tried several VBA's listed on this sight, but cannot seem to get a VBA that does everything I need it to do, and do it quickly. I have attached an example of my spreadsheet.

View 5 Replies View Related

Shortening My Code For Multiple Case Scenario

Jul 3, 2007

I have a combo box that is used very simply to select a column from sheet and copy that whole column down to where text ends into a specific column in another sheet. I.e whatever column is selected ends up in column B of this other sheet. At the moment I've been using If functions for each case but there must be a more efficient way of doing this; here is just a sample of my

If textseries1.Text = "Fund01" Then
With Sheets("data")
Range("C1:C" & Cells(Rows.Count, 1).End(xlUp).Row).Copy
End With
Sheets("calculations").Range("B1").PasteSpecial
End If

If textseries1.Text = "Fund02" Then
With Sheets("data")
Range("D1:D" & Cells(Rows.Count, 1).End(xlUp).Row).Copy
End With
Sheets("calculations").Range("B1").PasteSpecial
End If

If textseries1.Text = "Fund03" Then
With Sheets("data")
Range("E1:E" & Cells(Rows.Count, 1).End(xlUp).Row).Copy
End With
Sheets("calculations").Range("B1").PasteSpecial
End If

There are about 75 columns in total but thought it would be a little repetitive to put it all up here!

View 2 Replies View Related

Shortening VBA Code Of Copy / Paste Values With Transpose

Aug 11, 2014

I think I have a very straight forward problem, I'm copying about 400 values from one workbook to another (from vertical range to horizontal range) and I currently have about 400 lines of code in order to do this. Below I've pasted the code I'm using now but the macro takes an estimated 30 seconds to run. I figure if I can reduce the number of lines the macro will run a lot faster

RowCount = openWb.Sheets("Library Raw Shear Rates").Range("A3").CurrentRegion.Rows.Count
With openWb.Sheets("Library Raw Shear Rates").Range("A3")

[Code]......

View 3 Replies View Related

Shortening The Formula I Used For Calculating Number Of Public Holidays That Passed

Sep 25, 2009

I am using this formula to calculate a set of PH(Public Holidays) that have passed from a period of 1/4/2009 to 31/3/2010.

=IF(TODAY()>='Team Schedule'!D5,1.5,0)+IF(TODAY()>='Team Schedule'!D6,1.5,0)+IF(TODAY()>='Team Schedule'!D7,1.5,0)+IF(TODAY()>='Team Schedule'!D8,1.5,0)+IF(TODAY()>='Team Schedule'!D9,1.5,0)+IF(TODAY()>='Team Schedule'!D10,1.5,0)+IF(TODAY()>='Team Schedule'!D11,1.5,0)+IF(TODAY()>='Team Schedule'!D12,1.5,0)+IF(TODAY()>='Team Schedule'!H2,1.5,0)+IF(TODAY()>='Team Schedule'!H3,1.5,0)+IF(TODAY()>='Team Schedule'!H4,1.5,0)-4.5

From what u can see here, its a massive formula.... but I am pretty sure that there is a shorter way to key in the formula

*Note*
'Team Schedule'!D5-D12 and 'Team Schedule'!H2-H4 are PH. disregard the 4.5 that is in the formula as it is used for other purposes. Every PH that has passed will credit a 1.5 into the cell.

View 2 Replies View Related

Shortening VB Code That Deals With Deleting Row If Type Of Word Is Found?

Sep 17, 2012

I have a file with over 20,000 rows that contain a date (Mon~Sun), What I need to do is remove every day that contains Mon~Sat and only keep Sun, this is the code that I have come up with and is working.

Code:
Dim c As Range
Dim SrchRng
Set SrchRng = ActiveSheet.Range("A1", ActiveSheet.Range("A" & Lastrow).End(xlUp))3

[Code]....

View 1 Replies View Related

Data Validation Error "Source Evaluates"

Dec 16, 2009

I received the following data validation error: Source evaluates to an error. Do you wish to continue? I received this error after attempting to reference a named range on another workbook.

Steps I took:

1) Named the range E5:E123 on the set-up workbook Students8

2) In the Reading8 workbook, I created a name. I called it names and I had it reference =set-up.xls!Students8

3) In the cell, I selected Data-Validation. Allow--List Source =Names

View 2 Replies View Related

Pivot Table - Show Report Filter Pages Shortening Tab Names Even When Character Is 31

Mar 4, 2014

I have an issue with a Pivot table: I am using the 'show report filter pages' function and prior to this I have ensured my character length of that field is equal or less than 31 however when I hit the function the tab names are shortened to 26.

View 1 Replies View Related

Macro To Change Range / Action Depending On Worksheet (range To Autofill)

Sep 17, 2013

Currently my Macro should: Turn off any filtersNumber column A from 1 to 1000 (starting in A14)Drags formula from K14-O14 down to last row of data shown in column Athen puts cursor in last empty cell in column B ready for user to enter data

On point 3 - I want the range to be K14-O14 if active worksheet equals "EXCHANGES" but if its on the "VALUATIONS" tab the autofill range should be L14-P14

I have found bits and pieces of macros on the internet and put them together so if my macro below is not the most effective for my needs but here it is in it's current state:

Here is my macro:

Sub AddNewEntry()
'TURNS OFF FILTER IF FINDS ONE ON
Dim wks As Worksheet

[Code]....

View 8 Replies View Related

Autofill In Macro Range Is Constant How Can I Code To Be A Variable Range?

Feb 19, 2010

I am trying to write a macro which will autofill specific columns. The macro will set the range from the start of my autofill to the end of my autofill as a constant range.

The problem I need to get around is the end of my range can always change each time I run the macro. For instance, the first time I run the macro I may only need to autofill from row 4 to row 15. The next time, I may only need to autofill from row 4 to 23 (because of user updates). How can I make the end of my range not be a constant address but variable?

View 6 Replies View Related

If Statement In Macro: Macro To Change A Range Of Cells Colours Based On A Single Cell?

Mar 16, 2007

1st - Need a macro to change a range of cells colours based on a single cell having a value greater than 0.001. ie. cells A1 - G1 need to change to grey based on cell F1 having a value greater than 0.001 entered in it?

2nd - Also a macro for deleting the text contents of cell C1 based on cell F1 having a value greater than 0.001. Therefor if cell F1 has a number greater than 0.001 it changes the colour of celss A1 - G1 and also deletes the text in cell C1?

View 2 Replies View Related

Run Macro When Range Value Not Blank, If Not Run Other Macro First

Oct 10, 2008

I wanted to modify the below macro but don't know how. Could someone help me please? Please see the bold text below.

Dim shortmonth As String
Dim todaysdate As String
Dim enterdate As String
'GET DATE AND CREATE VARIABLES
enterdate = InputBox("Please enter the date in the following format: MMDD")
shortmonth = Left(enterdate, 2)
todaysdate = Mid(enterdate, 3, 2)

Workbooks.Open Filename:= _
"S:CMU Trade VerificationTrade Discrepancy Report " & [shortmonth] & " " & [todaysdate] & ".xls"
Sheets("Daily Archive").Select

***Do this step when when range A2:N2 is not blank, otherwise, run the "Daily Data" macro first and then do the below steps.

View 9 Replies View Related

Macro To Name A Range?

Mar 17, 2009

I’m writing a macro to assist me in creating a group of dependent lists. I need the syntax for naming a range with the content of another cell. For example: Cell A1 contains a word. I want to name the cell range B1 through B5 with the word currently populating cell A1. Is there a command I can use?

Right now, starting from A1 I use the copy command to copy the content of cell A1. I then select the range B1 through B5, place the cursor in the NAME BOX and press paste. See my crude macro below which performs everything but pasting the name.

View 2 Replies View Related

Add Range To A Macro

Dec 15, 2009

I have a macro i need to add a range too but not having much luck, i need to add columns D, G, J, M, & P to this code if poss.

View 2 Replies View Related

Macro For Updating A Range?

Apr 14, 2014

I just started learning VBA and I can't figure out how to create a macro that will update my date range. I need it to automatically add the next date in the next blank cell so it would be like this:

1/1/13 1/2/13 1/3/13 1/4/13

Here is an outline of my work book: GANTT4-1.xlsm

Id like a date to be added if the maximum date in row 6 is exceeded by a date in column k.

View 3 Replies View Related







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