Writing Macro To Check Cell Population And Then Run Another Macro

May 14, 2014

Basically, what I'm dealing with is an inventory system. When a cell value reaches below a certain quantity, we have a cell light up with the word "YES" (under the "re-order" column). What I'd like to do is have a macro that checks to see if that cell is populated with "YES" and if it is, to run another macro (which I already have written) that sends out an email notifying us of the need to re-order.

How it would work: The person pulling out the inventory would fill out this form and click "Submit"

submitbutton.jpg

I would then have a "call" code tied to the "Submit" button that when clicked, would run the macro to check cell population and send out the email. The email code is already written and works flawlessly on it's own. I just cant seem to figure out how to write a macro that checks for cell value and then runs it (or not) based on that.

View 14 Replies


ADVERTISEMENT

Auto Population Macro

Oct 23, 2009

I'll insert the code below. Basically I'm taking the sheet titled Old and based on part number then op number, automatically populating the new work center in the new sheet. It runs but seems to be caught in an infinte loop.

Sub DataPopulate()
Dim varOperNo As Variant
Dim varPartNumber As Variant
Dim x As Integer
Dim SFCTimesNew As Worksheet
Dim SFCTimesOld As Worksheet
Dim pnfind As Range

View 9 Replies View Related

Writing Macro

Jul 3, 2007

i have an report in which i need to delete the entire row if the column contains values more than 250K, but the chanllenge here is; if any of the cells in the column contains a formula then the macro should not delete the row.....

View 9 Replies View Related

Check Boxes Macro: Macro That Will Check If The Boxes Are Checked And If Not Ignore Them And If So Run A Certain Macro

Jul 28, 2006

I have numerous hyperlinks in cells on a worksheet, next to these I have checkboxes. I am looking for a macro that will check if the boxes are checked and if not ignore them and if so run a certain macro.

View 6 Replies View Related

Writing VBA Macro Or Function

Nov 5, 2007

I have Asset Class in Column I and if it is 364A-EL or 365A-EL or 368A-EL or 368B-EL or 369A-EL or 371A-EL or 371B-EL or 373A-EL or 397C-EL then 'POLES' assigned in to Owner Class (Column J).

If Asset Class is 366A-EL or 367A-EL or 367B-EL or 368C-EL or 369B-EL or 371C-EL or 373B-EL then assign UGCBL to Owner Class.

Should we write the macro or can it be accomplished by any Excel Function?

View 11 Replies View Related

Writing Numbers Using Macro

Oct 16, 2009

I'm trying to use code to write the numbers 1 to 100 in 10 rows of 10

1 2 3 4 5 6 7 8 9 10
11 12 13 14 15 16......................

So far i have the following which works:

View 4 Replies View Related

Writing/modifying An Macro

Oct 18, 2007

Every month I download a report from a state agency that I need to reformat, create charts from and send reminder emails based on some of the data. The report is downloaded as an EXCEL workbook containing a single worksheet. The worksheet is preformatted as a printed report. I have no control of this formatting and I can not get the data as a .csv file. The report contains 3 sections. See detailed report description below.

What I want to do:
1.Is copy the 3rd section of the report to a new worksheet.
2.Sort the new worksheet by name, and date.
3.Filter some names based on resource type.
4.Create a new file, which will be attached to an email to my boss for follow-up.

Originally I used the built-in EXCEL macro recording function and this worked for a couple of months. Then the number of rows in the 2nd section varied and my generated worksheet failed to sort correctly, and I lost the column headings so my filter no longer worked. The results were not something I could forward. I do not know how to modify the macro to search for the literals which end section 2 or start section 3 so I can copy the correct data to the new worksheet. I am not a VBA programmer, just an old-fart trying to do some administrative volunteer support for an important program, and really do not want to become one.

Detail Report Description:
Section 1: Headings –contain fixed headings in merged & centered cells.
Row 1 – Report heading 1 in merged cells A1–I1
Row 2 – Report heading 2 in merged cells A2-I2
Row 3 – Report heading 3 in merged cells A3–I3
Row 4 – Blank row............

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

Writing A Macro To Hide Rows

Sep 23, 2008

I am now trying to hide rows when the data in a column matches that of a cell with a data validation list. Ideally i would like only the rows with matching data to show. When the cell is changed then the visible rows change and when the the entry "total" is selected all the rows are shown. There are several small tables of data on a page so I can't use auto filter. The data areas will also change in size as new entries are added. So the last row in the data tables will increase over time. I will copy and apply the macro to each separate table of data.

As an example cell c19 contains "lwsf"

The data table is in the range c24:q47. the column with matching data is column D so all rows of entries with "lwsf" in column D should be visible and the rest hidden. When c19 is changed to "TF" then the rows visible become those with TF in column D and the rest hidden.

View 14 Replies View Related

Use More Than 1 Range Of Cells When Writing A VBA Macro

Nov 18, 2008

Just wanted to know if I could have a range or ranges which are split. The current range i have is N5:AV6. I need to miss out every 6th cell so am looking to do a number of ranges like this - N5:R6, T5:X6, Z5:AD6 etc etc. If this can be done could you show me how I would need to lay it out?

View 2 Replies View Related

Writing A Macro That Deletes Blank Rows

Dec 11, 2008

I need help writing a macro. I only have experience recording them, not writing them in VBA.

I need to check columns A and B for blanks. If A and B are both blank, I want the macro to delete the row and move on to check the next row. I need to perform this macro for the entire worksheet.

View 8 Replies View Related

Writing Macro To Extract Data From Web Page

Mar 17, 2014

As part of a research project i need to extract as much data as possible from a webpage. The problem is to access each table i have to follow lots of links which I can't get to work automatically.

Its from a greyhound-data.com. So an example would be I want to extract all the racing stats for every dog that raced in swindon between 1st jan 2010-1st feb 2010. When i put it in the search engine I get 512 races in a table. I have to follow the link on name of race for each race.. Then I have to follow the link for each dog in the racers box, 6 for each race. Then when i'm on the dogs page theres a link saying on the top of the page saying a nember of races eg. 67races (number will vary for each dog). If I press that I get a list of all the racing stats for that dog. Its that table i need. But i also need the dogs name as a constant column. I need the table for each of the 6 dogs for each race out of the 512.. So in total 3072 tables.. It a lot of data and I have no idea how to get it?!

My biggest problem is I don't know how to say follow the various links. And I don't know how to loop multiple times - once for each of the races in the original list and then for the 6 dogs.

View 4 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

Writing A Macro For Work That Can Loop Through Reference Numbers

May 13, 2014

I have attached a screencap of an example source table that I am trying to write a macro to manipulate each day. Starting conditions are that I have data in column A and B. Column A would be reference numbers that may be on one line, or more likely, on multiple lines repeating with varying counts. Column B is the weight associated with each line. I would need a macro that could loop through column A, determine if the ref number has changed, and then calculate/populate column C. Column C is the % of the total weight for the unique reference number. I have illustrated this in the table using column D. This is taking me incredible manual effort to complete right now and I do know VBA, I just don't know how to loop a variable range in this case.

View 9 Replies View Related

VBA Code To Check Cell Value And Run Macro

Apr 12, 2014

I need a vba code to run a macro when a specific word entered in a cell. i.e. when a word "Duplicate" entered in a cell O2, the macro run automatically.

View 1 Replies View Related

MAcro To Check A Cell Value Before Copying

Aug 26, 2009

I am trying to write a macro to check a cell value is "Y" before selecting a range and copying to a second sheet, if the cell value is not "Y" I just want an error message.

This is the code I have so far but I have an error, the macro selects the row but does not paste on the second sheet, it does clear the range of data.

Range("L16").Select
Check_Value = "Y"
If ("L16") = "N" Then
MsgBox "Sort Completed Jobs First"
Else
Range("A16:P16").Select
Selection.Copy
Sheets("R2").Select
Range("A1").Select
Myvalue = IsEmpty(ActiveCell)
Do Until Myvalue = True
Myvalue = IsEmpty(ActiveCell)
If Myvalue = False Then ActiveCell.Offset(1, 0).Select
Loop
Selection.PasteSpecial Paste:=xlAll, Operation:=xlNone, SkipBlanks:=False _
, Transpose:=False
End If

View 9 Replies View Related

Check Cell Before Running Macro

Feb 16, 2010

I need to check cell G5 (which is G4-G3) before running a macro. if G5 is zero i need to pop up a message to inform the user to enter data in cells G3 & G4. And if G5 is greater than Zero the macro shud run.

View 10 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

Macro: Check Cell Values In Column

Oct 13, 2006

I have a requirement where i need to check whether a value is entered in cells within a collumn and if so, it would set a default value to a cell on the same row but with a different collumn. this needs to occur on the run.

there are columns that i need to check and change the status column cell in accordance.

column client_name
clumn date
column start_time
column end_time
column status

first the macro is to check whether there is a client_name, if a value exist (example, smoth, doe, allen) it would set a default value to the status column on the same row as deviation (options are served, queued, deviation).
then it would check if the date & time columns have value and is less than current date time, it would change the status cell to queued.

i know that there are several nested checks (if then if then if then) the problem is that vba is not one of the languages that i master hence im totally lost here.

i can add the finalizing features and rollout the spreadsheet.

and one more thing. i have multiple sheets with the same layout where these checks and changes need to be performed

View 8 Replies View Related

Macro To Force Format And Check Barcode Check Digit

Nov 27, 2009

My company uses 4 types of barcodes 8, 12, 13, & 14 number barcodes for our products my problem is that I can't figure out how to force the barcode to format properly no matter how somebody enters it if they don't use spaces or put them in the wrong spots, I can't use custom formats because there is 4 different layouts

8 digit should be "#### ####"
12 digit should be "###### ######"
13 digit should be "# ###### ######"
14 digit should be "# ## ##### ######"

these barcodes are in columns L, M, & N also right now 'm using a formula in another cell to verify the barcodes by calculating the check digit and comparing it to the check digit typed the formula i'm using is

View 9 Replies View Related

Code To Not Run Rest Of Macro If Specific Value In Cell - Error Check

May 13, 2013

I have a cell built into my spreadsheet that serves as an error check (i.e. returns the word 'ERROR' if certain criteria are fulfilled on the spreadsheet). I'm trying to write something into a Macro that will check this cell and not allow it to run if it states ERROR, returning a dialog box to notify this, is this possible?

View 2 Replies View Related

Check & Change Cell After Adding Formula Via Macro Code

Apr 17, 2008

The loop is putting the correct formula into the cell - but THEN... - I wish to (within the loop and before it moves on) check if the value is equal to OR greater than 1 - if it is, make it a value of 1 (this '1' is then used at the bottom of the column of data to give a total). I need to do this before it moves onto the next cell. What am I doing wrong? Is it because once it puts formula in the cell, it then moves down - do I need to select the cell again first? As I had originally posted on this site - link: url]http://www.excelforum.com/showthread.php?t=641970[/url]

View 2 Replies View Related

Macro: Check CheckBox Is True, Current Date For Day/Month, Then Sum TextBox & Cell

May 28, 2008

I am trying to allow the Command Button when clicked to go through multiple conditions before making a decision. So, when someone clicks on Command Button 3 the code should look to see if CheckBox1 is true, then it should check today's date, and if it is between a range of days, or even months, then it would add the number in TextBox1 with the amount already in cell H18. This event will happen every time someone clicks on the Command Button.

The end result is to have several sheets (4 total) for each quarter in the fiscal year, and if the dates are within those parameters, the clicking of the command button will update the correct sheet.

View 9 Replies View Related

UserForm Cell Population Into Newly Inserted Row

Feb 28, 2014

I am trying to create a filterable To-Do List. My goal is to enter each item with a userform, which I have created and pops up upon clicking the "Insert" textbox. making the following macros happen:

1) I would like to insert the new item in a row at top of existing info, below the headers, with the populated information from the userform when you click the "Add" Commandbutton on the Userform.

2) I want to make sure any filtering is reset whenever a new item is entered so the list reverts to original appearance.

Attached File : To Do List.xlsm

View 2 Replies View Related

Sheet Population Depending On Cell Data

Jul 21, 2008

I currently written the following formula, but always have issues when adding additional depending on selection.

D8 is the selection ( Validation ) on PERF EXP FORM Tab, Once you enter the selection... you then go to the Accounts per hour Worksheet
=IF('Perf Exp Form'!$D$8="Test1 14-18 station",IF(('10220DBHE'!B9=A6),IF('10220DBHE'!C9 > 11000,11000,'10220DBHE'!C9),"N/A"),"N/A")

Perf Exp Form
Perf Exp Form *ABCDEFGHIJKLMNOPQ4 *1. GENERAL INFORMATION****************5Customer***Date / Name(s)*6ApplicationSheet Size1UP/2UPOrientationSOG/EOGFold TypeFold Plate# CH***78 1/2 x 142 UPPortraitSOGLetter/ZHeavy1***8Machine / model**Enduro 4-6 station9ConfigurationCHANNEL 1CHANNEL 2CHANNEL 310590-4720-4910 Dual DeckNONENONE11Date / Name(s)*** Excel tables to the web >> Excel Jeanie HTML 4 ......

View 9 Replies View Related

Writing A "Back" Macro

Dec 3, 2008

I have a series of hyperlinks that take me to named ranges. The named ranges are on different worksheets. Once there, there is no way to get back to the worksheet that hyperlinked me over.

Is there a macro that I can attach to a button that will take me back to the last worksheet? Does Excel record a history? I will hyperlinked from multiple worksheets so it has to link back to the last last worksheet opened prior to hyperlinking.

View 9 Replies View Related

Macro Check A Value

Nov 17, 2009

I'm at a point in the macro where I want to check a value.

Not sure how to write it.

Here's what I need.

If the value in B2

View 9 Replies View Related

Discount Check Macro

May 8, 2014

If I explain all the 8 steps , it will be lengthy and not easy to explain , thus I will go step by step

See file attached raw 01 , copy it on drive c directory called DISC , see file attached the result file

I want the the result file to go fetch data from the folder created DISC in which there is file called raw 01 and do the following with pulling headers , since the header is already plugged.

a to a
b to b
c to c
d is thus empty for the second step of the macro ( explain following after this fetching is achieved )
d to e
e to f
f to g
g to h
h to i
j to k
k it should not copy

View 5 Replies View Related

Macro To Check Internal Ips

May 26, 2008

we have a network of small routers and wifi aps. The Ip range has got a bit out of control so I would like to be able to audit it every once and a while.

how I could go through a set of IPs on a spreadsheet, open a telnet session or whatever, try pinging each ip individually, paste a response or no response in the adjacent column then move to the next ip in the first column (some sort of loop).

Time is not too much of an issue as I could run this overnight if need be.

As a response, the macro could just copy the last line of the ping eg

Minimum = 7ms, Maximum = 9ms, Average = 7ms
if it responds

or

Packets: Sent = 4, Received = 0, Lost = 4 (100% loss)

if it does not respond

Example

Col1 col 2
Ip
1.2.3.4 Packets: Sent = 4, Received = 0, Lost = 4 (100% loss)

4.5.6.7 Minimum = 7ms, Maximum = 9ms, Average = 7ms

5.6.7.8 Packets: Sent = 4, Received = 0, Lost = 4 (100% loss)

6.7.8.9 Minimum = 3ms, Maximum = 21ms, Average = 9ms

etc

View 12 Replies View Related

Macro To Check Part# And Sum

Apr 13, 2006

I have a huge spreadsheet that has part numbers and quantity. I need to find the same part number and sum the quantity of that part number.

View 10 Replies View Related







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