Date Search Macro Runs, But Returns No Results

Oct 6, 2008

I'm trying to make a macro to keep track of our rental properties. This macro, in another variant, worked as planned, searching for data in a column, copying the row to a new sheet, and clearing the contents of that row.
So I've tried to make it search for a date in a new workbook and do the same. It runs, and tells me it has returned zero significant results (did not find data to move and delete).
My column I is formatted mm/dd/yy . And the rest of the workbook is protected.
Here's what I have:



Sub CopyReturns()
'Macro written 10/2/08 by Jeff
ActiveSheet.Unprotect
Dim DestSheet As Worksheet
Set DestSheet = Worksheets("Sheet2")
Dim sRow As Long 'row index on source worksheet
Dim dRow As Long 'row index on destination worksheet
Dim sCount As Long
sCount = 0............

View 9 Replies


ADVERTISEMENT

Macro That Returns Specific Results From A Longer List

Aug 4, 2008

I am trying to write a macro that returns specific results from a longer list based on an entry in a cell.

For example if I have “Colours” typed in cell A1 in Worksheet 1 and there is a list on Worksheet 2:

Colours Black
Colours Yellow
Colours Green
Animals Dog
Animals Cat
Animals Tiger


Then I would like the blow answers returned in cell B1 on worksheet 1
Black
Yellow
Green

View 9 Replies View Related

Macro To Search Then Count And Paint Results?

Aug 6, 2012

I'm trying to make a macro to search in a list of indeterminate results, and when found, to count how many found results and select the ones found, and then to put the results in the cells I2 and J2

I already have this code, but is a bit out of what I want.

Code:
Private Sub CommandButton2_Click()
'dimensiona as quantidades de cada criterio
Dim c1, c2 As Long

[Code].....

This one open a MsgBox with the results, and i want the results on the cells I2(what it was search) I3(how many it was found) J2(what it was search) J3(how many it was found)

And this one also dont "paint" the cells with the results, and this one only search if you put the rigth sentence... Ex: if i search for "miguel" and the cells have "Miguel" it won't count :S

View 2 Replies View Related

Mid Function Returns Odd Results

Jun 1, 2006

I'm using the following phrase out of a much longer expression to
demonstrate that the return value of the MID function seems to be nothing I
can understand.

This expression:

=MID("6/10x",1,FIND("x","6/10x)-1))

returns 6/10 as text which makes sense. However I was under the impression
that when text in Excel contains numeric characters, it can be interpreted
as a number. So then how does the following expression,

=MID("6/10x",1,FIND("x","6/10x)-1)*1

return the result 38878? Does it still think it's text?

View 12 Replies View Related

Sumproduct Returns 0 Instead Of Expected Results

Sep 22, 2006

My SUMPRODUCT formula is returning 0 instead of expected results
=IF(ISERROR(SUMPRODUCT((WOR_Data!$A$2:$A$429=$A7)*(WOR_Data!$E$2:$E$429=$L7)*(WOR_Data!$K$2:$K$42))),0,SUMPRODUCT((WOR_Data!$A$2:$A$429=$A7)*(WOR_Data!$E$2:$E$429=$L7)*(WOR_Data!$K$2:$K$42)))

I have verified that all criteria match criterion for spelling, case, length(trailing spaces). All fine. First comparison is unit, second comparison is account description, 3rd argument of course column to be summed.

If I take out the error handler, I receive #VALUE! error

View 9 Replies View Related

Formula Returns Incorrect Results When Copied

Aug 4, 2006

My goal is to sum up the total sales and total forecasted sales of each cost center. I compiled a formula that is supposed to do this just as I want it to. Simple enough. However, for some odd reason the formula returns either the totals of ALL cost centers or just a zero instead of the correct result. The weird part is that when I check the formula by pressing the "insert formula" button it suggests that the formula actually should produce the desired result.

View 5 Replies View Related

Dropdown VLookup Menu Returns Multiple Results?

Oct 11, 2011

I'm attempting something new, a dropdown menu using vlookup to find data . If i use the simple example below, using data from B-D on 1 worksheet, where i want to find people by county:

A B C D
Search by County Name County Town
John Sussex Brighton
Eric Yorkshire York
Jim Cheshire Manchester
Liz Sussex Hove
Sarah Avon Bristol

I've created a dropdown menu on a second worksheet,A2, by county search, to return a persons name,county and town. The problem is if i select Sussex i will get 2 names who live in different towns within Sussex. I've created a simple vlookup which works fine, but because of Sussex having 2 results, i created a second vlookup for the second result to appear in the cell underneath.

The problem is that for the results that only have 1 result, the second vlookup returns a the same result as the first result, which i dont want.

Is there a way where multiple results will be shown if they exist, but for one result to appear if only one result exists?

View 9 Replies View Related

Query In An Access Database Which Returns Multiple Results

Aug 24, 2009

I have created a query in an Access database which returns multiple results. I need to be able to run this query within Excel, but only showing the total of the results in a single cell.

I also need to run it multiple times on the same sheet using different dates. The Access query asks for a date each time it's run

I have only found ways to retrieve the entire results of the query into Excel based on the settings within the query.

View 9 Replies View Related

The Results Of The Formula In Cell K36 In The Attached Spreadsheet Returns A Value Of Null

Feb 5, 2010

The results of the formula in cell K36 in the attached spreadsheet returns a value of null. It should be $1,200. Am I blind or have I done something wrong. I just can't see the problem with the formula.

View 6 Replies View Related

Grand Total Of The Calculated Field Returns Wrong Results

Apr 24, 2008

i have a problem regarding calculated field.. i have data of sales of a distributor with all the accounts that he handles.. i want to get the total number of buying accounts for that distributor..

buying account is an account that bought a specific product for at least one time... even the account buy 2 or 3 times more for that specific product the account is considered as 1 buying account..

i want to use a pivot table so i can manipulate the data.. first i tried to add an additional field to my data and put the formula
"if(norbo_val>0,1,0)" where norbo_val is the total sales less the rejects. it means if ever an account have positive sales the account is considered as a buying account for that specific product. my problem is that when that account bought the same product for 2 or more times it sums all the times an account bought for that specific product..

so i decide to remove the field in my data and create a calculated field in the pivot table. i input the same formula to the calculated field and it gives me the correct result where if ever an account bought a specific product for at least one time regardless on how many times the account bought that same product, the account is considered as 1 buying account. the only problem i am encountering now is that the grand total is not summing up the total numbers of buying accounts if i list all the accounts. it seems the formula is affecting the grand total where it should add the total of buying accounts but instead using the formula of the calculated field so the result is only 1.

View 9 Replies View Related

Search On Carriage Returns/characters

Jun 20, 2007

I have done a search on carriage returns/characters and what has been suggested is not working. I have BOTH carriage returns in the cell and also the boxes (that I assume are also carriage returns. I tried the substitute formula (=substitute(cellref,char(10),)) in excel but it only removes the alt+enter carriage return. I tried the various suggestions of find & replace but the chr$..etc did not work! Is there a formula to clear both in one (not a macro!)..?

View 2 Replies View Related

Excel 2003 :: Search For Date Macro

Dec 29, 2011

Looking for a macro in Excel 2003 that will open a pop up box so that the user can enter a date to search for within the spreadsheet.

View 6 Replies View Related

Creating A Macro, That Creates A New Button, Which Itself Runs A Macro..

Dec 15, 2009

I have a long complicated macro that processes a ton of data and gives the output in a new sheet. I then want to create new buttons (or some sort of user clickable triggers) on this new sheet that runs another macro.

I have got the actual adding of buttons in the sheet working, but I can't find a way to automatically assign macros to newly generated buttons during runtime. Is this even possible (or are there any clever tricks I could use to get around this?)

View 3 Replies View Related

Building Macro That Runs Another Macro Based On Certain Columns

Jun 6, 2012

Essentially, I am working with a database for a school and up until this point, each row matches up to a student with a bunch of information on them. One of these pieces of info is their parent's names. This is a much simplified look at things, but the screenshot below is a basic version of what everything looks like:

Now, the school wants me to split up the parents names from the student's and place them in their own row. I have recorded a macro to do this where you make the active cell the "full name" column for the row you want to expand, and then run the macro. Afterwards, up to two more rows are added, with the parent's names and some data copied. Below is a screenshot of what that looks like: (yellow is the new data generated, and blue is the active cell I marked to run the macro properly)

The issue is that there are thousands of these that need to be done, and I figured there is a way to do this with a macro. The issue is that not every row has parents names to expand out.

In layman's terms, I need a macro that will look at the two columns titled "Father's Name" and "Mother's Name" on each row of the spreadsheet and then, if there is any data in both or either of them, it should set the active cell to the "Full Name" column for that row then run the macro accordingly. After that it should repeat this all the way down, skipping any where neither of the columns have text in them

In the actual spreadsheet, the columns that need to be checked are AW and AX, and the column that needs to be set to the active cell before running the macro is B.

View 5 Replies View Related

Macro That Takes Workbooks Or Files And Runs Them Through Another Macro

Apr 25, 2007

i need to make a macro that takes workbooks or files and
runs them through another macro. i already have the 2nd macro
done and it is working perfectly i just need to know how to make the one
that finds the other files and runs them all through the macro i already made. My boss said that he will have about 150-200 files to run through this macro.

View 9 Replies View Related

Macro Only Runs Once

Nov 28, 2009

I can't seem to find an answer for this, but as an alternative, on Worksheet Activate the code runs and places a 1 in Range("A1") and therefore the next time the macro will not run.

This works fine for me, but just thinking if somebody who doesn't know why the one is in A1 and deletes it this macro will run again on sheet activate.

Private Sub Worksheet_Activate()
Dim LR As Long
Dim rng As Range

If Sheets("Charts").Range("A1").Value = 1 Then Exit Sub

LR = Sheets("POD").Cells(Rows.Count, "B").End(xlUp).Row

With Sheets("Charts")
.Range("I129").FormulaR1C1 = "=ROWS(R1C1:R[-128]C[-8])"
Set rng = .Range("A129").Resize(, 10)
rng.Copy rng.Resize(LR - 4)...............

View 9 Replies View Related

Find Statement Returns Empty When Search In A Range With XLWhole Option Enabled

Feb 21, 2014

Find statement returns empty when i search in a range with XLWhole option enabled

Code:

Private Sub worksheet_change(ByVal Tar As Range) On Error Resume Next
If Tar.Column = 1 Then
Set f = Sheets("Sheet2").Range(Cells(1, 1), Cells(5000, 100)).Find(Tar(1, 1), LookAt:=xlWhole)

[Code]..

but when i use Cells instead of Range ,Find command returns perfect result

Code:

Private Sub worksheet_change(ByVal Tar As Range) On Error Resume Next
If Tar.Column = 1 Then
Set f = Sheets("Sheet2").Cells.Find(Tar(1, 1), LookAt:=xlWhole)
If f.Column = 11 Then Sheets("Sheet1").Cells(Tar.Row, Tar.Column + 1).Value _
= Sheets("Sheet2").Cells(f.Row, f.Column + 1).Value
End Sub

View 1 Replies View Related

Lookup (macro To Search All Of Column In Multiple Sheets For A Date That Has Been Put Into An Input Box)

Feb 17, 2009

i want a macro to search all of column A in multiple sheets for a date that has been put into an input box.

the matching dates have data corresponding to them in that row. i want the date and data from the row to then be copied into a new sheet.

View 4 Replies View Related

Macro Only Runs Manually

Feb 5, 2008

Running Windows XP; Excel 2003

I have a fairly simply macro.

It copies certain sheets out of a workbook (for a new workbook)
Unprotect the sheets in the new workbook
Deletes a particular cell on each sheet
Unhides a sheet
Sets all of the new worksheets to normal view
Protects the new sheets
Lets the user save and name the new workbook.

All is working fine Except it will not change the new workbook from Page Break View to Normal view.

The code I'm using = Sheets("name").Activate
Activewindow.View=xlNormal

Here's the strangest part. When I run the macro from a command button, the newly created workbook retains the page break view (as is in the original).

When I run the macro line by line via F8, IT WORKS JUST FINE

View 9 Replies View Related

Macro Runs For A Bit And Then Crashes

Feb 15, 2008

I have created a macro in xl2000 which was working fine - although through corporate upgrades my machine has now been upgraded with xl2003 and the macro runs for a bit and then crashes on the code below, although it only highlights teh 'rnum'

rnum = ActiveCell.Row
Is there a difference between xl2000 & xl2003?

View 9 Replies View Related

Macro Runs Slow

Nov 13, 2008

The code below runs on a spreadsheet that has approx 600 rows which INDEX and MATCH another spreadsheet which has approx 600 rows. I takes about 4 mins to run.
Sub QC()

Range("T1").Select
ActiveCell.FormulaR1C1 = "Compared CCCD"
Range("V4").Select
Columns("T:T").ColumnWidth = 15.29
Range("S1").Select
Selection.Copy
Range("T1").Select
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Application.CutCopyMode = False
Columns("T:T").Select...................

View 9 Replies View Related

How To Create A Graph Where Date Starts On July 1st And Runs Through A Full Year To June 30

Jan 14, 2014

I am trying to create a graph where the date starts on July 1st and runs through a full year to June 30. No matter how I sort the dates in the cells, the graph still wants to start in January. You will see from the attached picture the very right lines up with the very left, where these should actually be meeting in the middle. as to what I need to do? Please see photo and dataset.

Chart.jpg
DataSet.xlsx

View 3 Replies View Related

Hyperlink To Search Results

Sep 18, 2012

I have "Sheet1" with thousands lines of data like following

ID Customer value date etc,......
2434 ABC 500 2012 data
2654 DEF 600 2013 data

and another sheet "sheet2" to hilight attention to a risk or issue like following

ID description status to do by etc,....
2434 missing items follow-up and fulfill Eng. A

I need to add a hyperlink to the ID number in BOLD to link me to the line matching in sheet1.

View 9 Replies View Related

Highlighting Search Results?

Jun 18, 2014

I want to highlight particular characters in an excel cell. This cell may contain other words as well.

For example, if i search for the word "apple" in the excel sheet, only that particular word in the cell should be made bold. the cell may contain " I like apple". in this case "I like" should be left as it is.

View 1 Replies View Related

Turn Autocalculation Off While Macro Runs

Mar 11, 2009

I have a macro which reads data from a large number (up to 500) of books in a folder. This extracted information is subject to some fairly heavy analysis which means that the macro runs very slowly as the sheet is constantly calculating.

I would like to add some code - maybe after 'screen updating = false' - that would turn off auto calculation while the macro runs and then restore it once the macro is finished.

View 3 Replies View Related

Open Workbook Macro Only Runs Once..

Jun 30, 2009

i have a button on my workbook1 that opens another workbook (lets call it workbook2) and automatically runs a macro on opening it. Once opened i have a button on workbook2 to close itself. I then go back to see workbook1. This all works but then when i click on the button to open the workbook2 again it opens but the macro does not run.

View 4 Replies View Related

Macro That Effectively Runs All The Time

Jul 20, 2009

Is it possible to have a macro which effectively runs all the time.

For example, if the user imputs something which is wrong I want the macro to pick it up straight away with a message box.

View 13 Replies View Related

Splash Screen While Macro Runs?

Sep 24, 2009

I searched for this and found a few examples on splash screens, but if someone could help I would appreciate it.

Basically I have this massive macro that runs, I recorded some of it, and VBA the rest. It does a bunch of things like bringing in different spreadsheets, formatting vlookups blah blah blah... Anyway for a nice touch I was hoping that I could get a splash screen or something that will run while this macro is running in the background. How hard would this be? The macro is button driven...

View 9 Replies View Related

Unlocking Cell After Macro Runs

Dec 17, 2009

I have a macro in my worksheet that runs as a change event on certain comment cells. This macro unprotects the worksheet, expands the merged comment cell that just change, and re-protects the worksheet. The cell expansion works great. When I re-protect the worksheet all of the cells work correctly, except the cell that was just changed. Any other "unlocked" cell in the document stays unlocked after the protection is applied, but the cell that just changed becomes locked. I need this cell to remain unlocked to allow the user to update the comments. Here is my full

View 3 Replies View Related

Run A Macro That Only Runs On The Filtered Data

Jan 11, 2007

I have a spreadsheet that is made up of single line items with sub-totals at various points going down the sheet (ie the spreadsheet is split into sections)

Each section is about 100 rows long and 40 columns wide, 10 of which are sub-totals, all using the same formula from that i enter in column A.

As i add new sections i have recorded a simple macro that copies the active cell (ie A15 for example). It then pastes into D15, F15, H15, N15, X15 and then returns to A15.
I have linked this up to ctrl X for ease of running.

I have around 500 section totals to "ctrl X", per spreadsheet and 10 spreadsheets to do in total. I have firstly filtered all the line items (rows) out to leave me just the sub-totals to [ctrl x] [arrow down] [ctrl x] [arrow down] [ctrl x] etc etc etc....
Is there anyway to automate this process, i have tried recording another macro of me [ctrl x] [arrow down] about 30 times, but when i run it, it pastes on the hidden rows, not just on what you see on the screen. Is there a bit of code i can enter so it only sees what is visible.??

View 9 Replies View Related







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