VBA To Add Rows Or Columns If Information Not Exist

Jul 24, 2012

I have a spreadsheet that contains overtime information for employees. Basically, it has a list of names in column A, and a list of projects in the first row, similar to this:

Name
100323
100887
100987
100987
Sum

[Code]....

At the top of the page I've inserted a section similar to this:

Name
Project Number
# Of Hours

SMITH, John
100883
5

Where the name and project number are drop down data validation lists containing all of the project numbers and employees at our facility, and the # of hours section is just a manual entry.

I require a macro that, upon clicking a button, will verify that the name is in the list and insert a row if there isn't as well as verify the project is in the row and insert a column it isn't.. then it will add the number of hours i specified in the box. It would also be nice if the list of names would sort alphabetically and the project numbers would sort numerically from left to right after any additions. As well as clear the selections and # of hours I entered in the second table shown above once everything has been entered in to the main (first) table.

I'm pretty new to creating my own macros (even though im an engineer.. )

View 1 Replies


ADVERTISEMENT

Sorting Columns And Keep Information In Rows Intact

May 26, 2009

I am trying to sort/filter the information by columns but I need the information in each row to stay together for instance...

1 2 3 4 5
2 3 4 5 1
3 4 5 1 2
4 5 1 2 3
5 1 2 3 4

I need to sort the numbers in column 3 in ascending order or filter them but i need the entire row to move when sorted so it needs to look like this


4 5 1 2 3
5 1 2 3 4
1 2 3 4 5
2 3 4 5 1
3 4 5 1 2

I am using the list function to sort and filter the data in the columns but when i try to sort them in ascending order i get....

1 2 1 4 5
2 3 2 5 1
3 4 3 1 2
4 5 4 2 3
5 1 5 3 4

I don't know how to write formulas or VBA's or anything but am willing to try.

Is it possible to sort the data and get a result like the second set of data? and is there an easy way to make this fool proof so people that use the spreadsheet will not mess up the data?

View 8 Replies View Related

Prevent User Seeing Senstive Information In Hidden Rows/Columns

Aug 19, 2008

I have a feeling the answer to this will be 'no' based on the searching I've done, but is it possible to allow formatting of rows/columns on a protected worksheet, yet prevent the user from unhiding some rows/columns I don't want them to see? I've allowed them to format rows/columns so they can "size" them to fit the text they enter, but that has opened up the ability for them to unhide columns. Using Shrink To Fit would be cumbersome due to the number of cells involved.

View 5 Replies View Related

Search If Value Exist On Another Tab In 3 Columns

Jun 14, 2007

I have this situation

On the first tab there is a list of IDs
45
676
234
451
788

On the second tab there are thousands of IDs in 3 columns (A,B,C)

What should be the best way to click on the button on the firs tab and see 'yes/no' whether ID exists in second tab in any column ?

View 9 Replies View Related

List Values That Exist Across 2 Columns

Sep 6, 2007

I am trying to use the function Match into the Index function but as a Result I have nothing than N/A#, I would like to be sure that I'am using this function in a proper way

Workbooks(filename_appli).Activate

Range("B" & dercell_appli, "C" & première_ligne).Select
Set Rango3 = Range("B" & dercell_appli, "C" & première_ligne)

Range("C" & dercell_appli, "C" & première_ligne).Select
Set Rango4 = Range("C" & dercell_appli, "C" & première_ligne)
ws.Activate
dercell_unit2 = Range("C65500").End(xlUp).Row
For y = 4 To dercell_unit2
Coincidir = Application.Match(Rango4, Cells(y, 3), 0)
Cells(y, 2) = Application.Index(Rango3, Coincidir, 1)
Next y

View 6 Replies View Related

Extract Values That Exist In All Columns

Aug 8, 2008

Each column represents a user and each row represents an application the user has. I would like to extract all the applications that are common to all the users and place it in an arbitrary column.

For example

User1_____User2_____User3
Office_______Office_____Office
Adobe_______Adobe____Adobe
Flash________Flash_____Snake
Firefox_______Firefox
Solitaire

The above list should generate Office and Adobe since every user has Office and Adobe.

View 6 Replies View Related

Merge Several Columns If Duplicates Exist In Column A

Apr 13, 2008

I have got a wordlist in worksheet "original" which looks like:

Before: [Code] .....

I need a macro which merges the columns B,C,D,E and F depending on if there are duplicates in Column A or not. If there are one two or more duplicates in column A,then those should be deleted and only one of them should remain in column A. The members of deleted duplicates in column B,C,D,E and F should be merged together. No duplicates should be made by the process of merging. Each member in column B,C,D,E and F has to be unique. The results are supposed to be put in worksheet "new".Columns B,C,E and F should be merged through signe "/". And Column D should be merged through signe ",".

After: [Code] ......

The macro must be able to deal with very large lists. biger than 200 000 words in column A

Here is the excel file containing the example : excel file

View 14 Replies View Related

Merge Columns B,C,D,E And F, If Duplicates Exist In Column A

Apr 13, 2008

i have got a wordlist in worksheet "original" which looks like:

Before:

View 14 Replies View Related

Add Rows From One Sheet To Another Only If It Does Not Already Exist?

Jun 22, 2013

I have two sheets containing data, Sheet 1 and Sheet 2. Sheet 1 contains columns A-P, while sheet 2 only contains columns A-K.

Some of the records listed in Sheet 2 are already in Sheet 1 with more complete data, but there are some records not in Sheet 1 and the only information available for these records is in Sheet 2.

I am looking for a macro that will compare columns A in Sheet 1 and Sheet 2 and for any records found in Sheet 2 but not sheet one, the entire row A-K of Sheet 2 will be added to Sheet 1.

View 1 Replies View Related

Determining If Duplicate Values Exist Across A Row (then Do That Over 2000 Rows)

Jun 19, 2014

I am trying to determine if the value in cell Y2 also exists anywhere in cells AE2:QE2.

My initial stab at it is

[Code] .....

This results in a #VALUE! error (I am pretty sure that's because excel doesn't like the AE2:QE2 part).

I would do a formula-driven conditional format for this, but I have 2000+ rows that need to be acted on, so that's not feasible.

Is there any way to have excel check if the Y2 value exists in AE2...QE2, cell by cell?

View 6 Replies View Related

Match 2 Columns To Copy Information In Other Columns

Apr 21, 2007

I have 2 workbooks (workbook1 & workbook2). Information in column A and column N must match both workbooks per row/ cell (ie. if A2 and N2 in workbook1 match workbook2, copy information from 3 other columns (S, T, U from from workbook1 into workbook2 - cells S2, T2, U2). Workbook2 may have information in column S, T, U, but I need to over-write it with the information from workbook1. If the information does not match per that row/cell (ie. A2 in both worksheets are the same, but N2, they are not, so go to the next line that does match and copy the information into worksheet2). I do not want to use a V- lookup for this problem. I really need a marco.

View 3 Replies View Related

Information From 2 Columns

Mar 11, 2009

I am unsure if this was answered already but I am having a lot of trouble. I am trying to find out if it is possible to count the number of entries in one column if it meets criteria in another comlumn?

Here is my problem: I work for a contractor and I am trying to find out the number of contracts sold(column J) by Mike (Column K). I have tried =COUNTIFS functions but these dont work. I know if I create 4 other columns with IF functions I can get the information but I have to imagine there is another way.

View 9 Replies View Related

Merging Two Columns Of Information

Jul 16, 2009

I have two very long columns of client names. The columns represent reports that were run at different times on the same information.

What I want to do is merge the two clomuns. The issue is that there are many names that are the same but some that are different. Is there a way that you can merge the info. So it ignores the client names that are the same but auto adds the ones that are new. There are financials in other columns that I want to have come along during the merger.

View 7 Replies View Related

Search 2 Columns Of Information

Aug 2, 2007

I have the following code below, im not sure how to modify it to make it only search 2 columns of information, how can do this?

Private Sub CommandButton3_Click()
Dim StrFindWhat As Range
Dim NextCell As Range
Dim WhatToFind As Variant

WhatToFind = Application.InputBox("Please enter the Application or Service you want to search for?", "Search", , 500, 80, , , 2)
If WhatToFind "" And Not WhatToFind = False Then
For Each oSheet In ActiveWorkbook.Worksheets
oSheet.Activate
oSheet.[b4].Activate.....................

View 9 Replies View Related

Separating Information For Text To Columns

Oct 2, 2008

I have a list of 2500 companies. In each cell there is the company name, street address, and phone number. And of course, each one is of varying length. I need a way to put the company name, street address, and phone numbers in seperate columns. I tried going to text to columns but it wouldn't work due to the varying lengths.

View 5 Replies View Related

Concatenate With Loop Through 2 Columns Of Information

May 28, 2014

I have a list of names with blank cells in Column A cell 2.

I want the programme to scroll through this column until it finds a name, when it does I want it to look in cell offset(1, 1), in this case B3 to see if there is a number. I want this number to be moved to offset (0, 1) AND any subsequent numbers below it until the next blank cell in that column (B).

In the attached image cell B2 will contain all numbers in cells B3:B9 with a / between them. Cell B10 will have number from B11 and B12 will have B13:B15. If there is no number it will just continue to the next name in column A. My rough code below delivered the first number only in the relevant cell and I'm not clever enough to get it right. It does not have to be super slick as it's for one time use.

I need numbers in column B cleared as they are concatenated into the single cell.

Spreadsheet.jpg

View 12 Replies View Related

Multiple Columns Of Information Function

May 6, 2009

Ok this is what I need to do:

I have worksheet A with cell AC2 to enter a team id# like 51922 for example. In Cell B3 I want it search sheet11 for the team name according to the number and put the team name in B3. Sheet11 has 11 columns the first one list the 613 team names, the remaining columns have #'s like the example giving for the teams. What formula would I need to perform this function?

This is a football game the other 10 columns represents 10 worlds with identical 613 teams to control in each world, but the teams have different #'s to identify the world, team, and coach.

View 11 Replies View Related

Filter Information Within Multiple Columns

Sep 5, 2012

I am having a problem filtering information within mulitple columns. I do not understand how the advanced search works either, so let me try to explain what is going on. I would post a pic of the table to make it easier to understand if I knew how to.I have thousands of rows in Column A with information, for this scenario a number. Thing is that all these numbers are seperated by many blank rows.

Ex: Row 1 has a number, Rows 2-10 are blank, Row 11 has a number, Rows 12-24 are blank, etc. Over in Column C, for every row that has a number in Column A, there is a corresponding number in Column C followed by Rows of numbers. ex: Row 1 Column A has corresponding information in Rows 1-10 of Column C.If this is clear, understand that this repeats for tens of thousands of lines. When I am looking for a specific number in Column A, I do a filter for just that number.

When that happens, it only brings up the info from that same row in Column C. I need the filter to bring up all ten rows of info in Column C that correlate to the row I filtered in Column A. I know the easiest way is to label all the rows in column A with the same number, but the reason the blanks are in place is so it is easier to read the breaks between the different information.

View 1 Replies View Related

Parse Information Across Multiple Columns

Aug 14, 2005

I have data that I copy from one sheet and move it to another. If I know I'm parsing data that may vary in amount of line items but will always be across 3 columns is there a way to parse this data evenly.

for example:
I would like to look in column "D" and if there is an "A" I would like to parse cells A,B,C in that row to sheet 2 and parse this information evenly across 3 columns evenly across columns "A,E, I"
In my example the data is only 21 rows of information the problem I have is evenly parsing this information.

View 9 Replies View Related

Exchanging Two Rows Of Information With Each Other?

Dec 11, 2012

this may seem like a relatively simple thing, but I want to take two rows of information and just switch them with each other. I want all of the formatting to stay the same though relative to each other. The problem is a color name. I have four colors of a pant that I'm tracking for production and the color order is just slightly flipped so I need to switch two of them. I don't want to have to redo the whole thing, too much info!

View 2 Replies View Related

Drop Down List: Looks At This Range And Then Populates This Information Into Columns

Oct 26, 2009

I have a 5 row list in WA2. Each row holds its data across 3 columns i.e A1description, B1 product code, C1 unit cost. In WA1 I want to have a drop down table in cell B3 that looks at this range and then populates this information into B3, C3 and C4. I have tried data validation but it keeps telling me that it can only look at a single row or single column

View 2 Replies View Related

Repeating Columns And Information On Multiple Sheets In Same Workbook

Nov 18, 2013

Is it possible to automatically have columns repeat through all sheets in a workbook? I keep an annual book, broken down by sheets for each month. I always have to add 5 columns to each sheet, and was wondering if there was an easier way..?

View 3 Replies View Related

Mail Merge Of Information In One Cell To Numerous Columns

Feb 23, 2010

I have a report that the name and address was put into one cell. I need to put this into numerous columns so I can do a mail merge.

View 9 Replies View Related

How To Combine Rows Of Data With Like Information

May 13, 2014

I have 500 rows of data with 6 columns. Columns A,B,C,D,E are text, and column F is values.

I'm looking for a formula where I can say for any of these rows where the data in columns A through E match each other in those rows, combine them into one row of said text, with column E values totaled. I thought I could use SUMIFS for this, but I only know how to define SUMIFS with the criteria being a specific cell/text/value for which it should search on. In my example, the data in the cells can be anything, I just need rows to be "collapsed" to one row for like data.

View 2 Replies View Related

Reference Corresponding Rows Of Information Neatly?

Oct 9, 2008

I've manually inserted of what I'd like the program to be able to figure out, and a description of what I've tried, and failed at, so far.

The product codes and prices would of course all be unique, I've just mashed this together so there's some generic info, and I'm not divulging confidential.

View 2 Replies View Related

Duplicate Information To Be Removed From Different Rows?

Sep 24, 2013

I'm busy cleaning information from an excel spreadsheet. Not all the columns are populated. e.g. Row 17 will only have an email address in column E whilst row 18 will have a name, surname, company and email address (same as in row 17).

Using the remove duplicate function, removes row 18 and thus leaves me with the row that only contains the email address.

What would it take for me to be able to remove the rows that do not have the additional columns populated?

View 2 Replies View Related

Moving Rows When New Information Is Added

May 18, 2012

I have a workbook where on one sheet various peoples information is listed and based on their organization the information is then linked to one of a few different worksheets for costs. On the cost worksheets, when a new person is added to the original worksheet, their information populates the next row. At the end of the cost columns I have a the total cost of each person added together. What I need to do is have these totals continue to move down the worksheet as new people are added. Is there a way to do this in excel using VBA or another function?

View 1 Replies View Related

Converting Column Information Into Rows

Jan 5, 2013

I have a set of training information in the rows, with dates under it which maps back to names of employee in the left hand side. How do I convert that to Name of Employee Training attended dates expiry date.

View 8 Replies View Related

Insert Rows Between Blocks Of Information

May 11, 2006

I have used some code that Kris gave me a couple of weeks ago and changed it to insert a row between each block of information. Have I got it right?

Sub InsertRows()
Dim lRow As Long
Dim r As Long
lRow = Range("A" & Rows.Count).End(xlUp).Row
Application. ScreenUpdating = False
Columns("M").Insert
[m3] = "temp1"
Range("M4:M" & lRow) = "=LEFT(A4,5)"
For r = Cells(Rows.Count, 1).End(xlUp).Row To 2 Step -1
If Cells(r, 13) <> Cells(r - 1, 13) Then Rows(r).Insert Shift:=xlDown
Next r
Columns("M:N").Delete
Application.ScreenUpdating = True

Application.DisplayAlerts = False
ActiveWorkbook. SaveAs Filename:= _
"H:HOME imcEXCELCOUPON_COUNT5_MAYREFORECAST.xls", FileFormat:=xlNormal _
, Password:="", WriteResPassword:="", ReadOnlyRecommended:=False, _
CreateBackup:=False
Application.DisplayAlerts = True
ActiveWindow.SelectedSheets.PrintOut copies:=1
End Sub

View 3 Replies View Related

Edit Customer Information Rows

Jul 1, 2008

I am trying to develop a procedure that allows the user select a customer from a drop down list (using Data validation), thereby providing the user with a summary of customer information. That I can do. What I would like to do is allow the user to add new information in the summary section which is then appended to the customer record further down the sheet (see attached example). New data could only be added to the last two columns. The user would be required to press a form button to append the data.

The catch would be if the customer was selected again, the new data would also display in the summary section.

View 4 Replies View Related







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