Combine Two Tables Which Change In Rows Depending On Input Of User Using VBA In Excel?

Apr 13, 2014

i have a macro which takes the results generated and puts them into a table and filters the data so that zeros does not show and arranges the table from largest to smallest. Now i have a problem where i need to select the power, fuel oil consumption, weight and area from one table and the other power, fuel oil consumption, weight and area from the other table and combine them together so that i can have all possible combinations of the data, but i don't want the zeros to show in the combinations. i need the combined data to show on a separate sheet. The data of table 1 varies with rows as shown:

The Data of Table 2 varies with rows as shown:

I would like to achieve a result like this in the following columns and rows without having to input them manually:

View 1 Replies


ADVERTISEMENT

Excel 2010 :: Convert Multiple Columns To Rows Depending On Input Value

Jul 6, 2014

I have lot of data in Excel 2010 which I wish to bring in Columns using a Macro depending on the input value which the macro should prompt me. For E.g.:

A1B1C1D1E1F1G1H1I1J1
12345678910
12345678910
12345678910
12345678910
12345678910

If I select data from A1 and J1 (in practical it will be more Columns) the Macro should prompt me how many Columns would be the output on Master Sheet. If the input is 2 then it should create an output Sheet "Master" and should show the following result

A1B1
12
12
12
12
12
34
34
34
34
34
56
56
56
56
56
.. ..
.. ..

It after selection I run the macro and input 3 then the output should go in three columns (A1,B1,C1) one below other. If 4 is Input then 4 Columns (A1,B1,C1,D1) will come below each other so on and so forth.

View 6 Replies View Related

How To Use VBA Array To Combine User Input Form

Jun 19, 2013

I have a form created using the instructions here [URL] ..... however I only have two boxes that I need completing. What I need to do is combine both inputs from the form into one cell. The code below shows this working but I am unable to get the array to work.

Essentially I need to get the array to drop in the old number and new number into the new cell so it looks something like this:

Old Number - 1234
New Number - 6543
Value in cell 1234 6543

The code I am using is set out below:

VB:

Private Sub submitmeterswap_Click()
Dim iRow As Long
Dim ws As Worksheet
Dim myarray As Variant
Set ws = Worksheets("x")

[Code]....

View 4 Replies View Related

Combine Rows From Matching Certain Criteria In Two Tables

Jun 9, 2013

I have a spreadsheet that contains two input tables: Parallel and Perpendicular. Next, the user can select a group which a certain entry belongs to. Now what I want is a "summary" of these entries in a table that has no blank rows and combines both Parallel and Perpendicular entries by the Group. Please note that there is no fixed number of inputs for any one group i-e the solution has to be dynamic.The groups are numbered from 1 to 6 and number of groups is fixed i-e 6.

A sample file illustrating the inputs and required output is attached.

I also posted this on: [URL] ....

Sample_file_summary.xlsx

View 2 Replies View Related

Combine Rows From Two Tables In Certain Order And Matching Certain Criteria

Jun 9, 2013

I have a spreadsheet that contains two input tables: Parallel and Perpendicular. Next, the user can select a group (from a drop down) which a certain entry belongs to. Now what I want is a "summary" of these entries in a table that has no blank rows and combines both Parallel and Perpendicular entries by the Group. There is no fixed number of inputs for any one group i-e the solution has to be dynamic.

Attached is a file illustrating the inputs and the required output. I would prefer a formula based approach but not against VBA based suggestions either.

Sample_file_summary.xlsx

Also posted at: [URL] ....

View 2 Replies View Related

Clear Data Depending On User Input And Move Cells Forward Without Deleting Data Table

Oct 25, 2012

I have an month input in cells B2 (user can enter values from 1-5)

I then have a data table that has month 1,2,3,4,5 running across range G9:K9. the data is held in range G10:K19.

So if user types in 4 in B2, what should happen is that months 1,2,3 and 4 the data for these months should be cleared and data in month 5 moves forward into month 1.

So basically, anything left of the month entered is B2 should be cleared and replaced with anything right of the month in B2.

1
2
3
4
5

£11
£133
£29
£193
£100

[Code] ........

View 3 Replies View Related

Automatically Copying Rows From One Sheet To Another Depending On A Cells Input

Jun 2, 2009

i have a certain column that tells me if a client has withdrawn from the company, and the column just says "y" or "n" i want excel to automatically copy the whole row to another sheet if that cell is a "y" for yes the client withdrew...

View 9 Replies View Related

Change User Input Values Depanding On Option Buttons

Oct 8, 2008

I have set up an option frame with two options. If I click on option A it shows below a frame with txtLenght and txtWidth.

If I use option button B it shows me on the same spot a different frame with txtSQM. I need that so I could either enter the length and width to get the sqm or I do already have the sqm value.

When I set up the code I would like to use an input message saying "Enter Lenght & Width" but if I use the other option it would need to say. "Enter the sqm value".

How or what code do I need to enter to be able to seperate those two from each other.

But also it is important that it does only calculate either the value in sqm or the values from length and width.

View 9 Replies View Related

How To Change Variable Data Type To String If User Input Is Not A Number

Jun 3, 2014

I have declared a 'long' variable. however; how do I change the variable data type to string if user input is not a number? how do I recognize the user input's datatype?

View 7 Replies View Related

Combine Rows With Similar Info In Dropdown Menu Or Selection For User

Nov 29, 2012

I have a spreadsheet that has a long list of charges... some of those charges have multiple codes attached to them... when this happens I am wanting to group them together and let the user pick which one they want to view at one time.

Here is a very small example of what exactly I am referring to... with charge #14 I am wanting it to combine and let the user pick between 2565 and 2566. The problem is that the values can range and will not always be 2565 & 2566 and there is 10,000 + records similar to this.

test.xlsx

View 1 Replies View Related

Log User Input In Successive Rows?

Feb 4, 2014

I am trying to build a user-friendly Excel database that takes the user's input from various cells and logs that data input by the user in successive rows to the side. Please see the screenshots of my current spreadsheet below:

Compressor Database.jpg

From the screenshot above, I would like for the user to input their data for the Date of Last Inspection, Current Hours, and check the boxes for any services they performed in the orange/pink "Input" box on the left. Currently I have the spreadsheet set up so that the orange/pink "input" areas recognize data put in to the yellow "Data Log" cells to the right. I am trying to get the yellow "Data Log" cell area to store the Date and Hours data put in by the user in successive rows like a database, but I am not sure how to do this. I was thinking of putting a button in the says "Log Data" which would, when clicked, store the data in the "Data Log" cells. I am unsure if I need to use a Macro or whether Excel has a simple, built-in function that can be used. Eventually I have plans for the "Date of Last _______ Change" Gray boxes, but would like to take this one step at a time.

I am not well versed in VBA and Excel Macros, and I am currently using Microsoft Excel 2007 (yes, I know it is old). I do have C# and Matlab coding experience, however I would like to do this in Excel to make it easier for the User as it is a well known program.

View 14 Replies View Related

Reference Cells Keeping Columns The Same But Change Row Number Based On User Input

Dec 10, 2012

Date
#
Lname
Fname

[Code].....

With that said, I want to put the row number of a user in (I have a few thousand on this spreadsheet, and all the = data be automatically pulled based on the row number I put in cell B1. So I'm hoping to write in cell B1 the following - "143" (without the quotes), and the remaining cells in column B automatically pull that data based on that, so it would look like the following

Row #
143
Name:
=C143&" , "&D143&" "&E143

[Code]....

How do I write the functions to keep the columns the same, but change the row number based on the number I input?

View 3 Replies View Related

Delete Rows Based On User Input

Mar 6, 2009

1) Allow user input of a number between 1 and 999

2) Search column three and delete any rows that don't match this number.

I have some code that would delete any rows within a certain column, based on predefined criteria and i've tried modifying it to suit my needs.

View 7 Replies View Related

Insert Number Of Rows Based On User Input

Apr 23, 2014

I have an excel sheet that I've automated for my shop ... Basically it copies a set of rows from one sheet, asks for which cell you want to start the paste at, then pastes it... Here's what I have so far:

[Code] .....

So I tried to use a variation of strReturn to indicate number of rows wanted but that didn't work ... Basically I'm going to create the "data" to include 50 rows, but have it selectable for the user to say they only want 5, 7 or 29 rows ...

View 2 Replies View Related

Code To Delete Rows Based On User Input

Aug 21, 2008

I am using the following piece of code to delete unwanted rows from a worksheet:

Sub DeleteDates()

FinalRow = Cells(65536, 3).End(xlUp).Row
For i = FinalRow To 1 Step -1
If Cells(i, 3).Value Like "*2007*"
Cells(i, 1).EntireRow.Delete
End If

Next i

End Sub

What I am working with is a sheet of about 5000 customer appointments going back to the beginning of 2006. A have peiced together a lot of code to format it exactly as I want and to create a pivot table of what is remaining after the rubbish has been deleted.

However I am finding that I need to keep amending and re-running this bit of code, depending on the date range I want to look at. For example the code above will delete all appointments made in 2007.

My question is: is there a way that I could incorporate an input box, whereby excel asks the user for a start date and an end date and deletes any rows outwith that range?

Some important info: All of the dates are in column C, in the format mmm yyyy

I would only need to narrow down to a month - so for example mar 2008 - jun 2008

View 9 Replies View Related

Insert Rows Based On User Input But Then Auto Delete Them At The End

May 25, 2013

I have a spreadsheet that I use throughout the day and have to send an email to another person when a customer makes a payment. The number of products they pay for will be different each time and I have the code to copy the right cells into an email and the code to insert the right number of rows for how many things the customer is paying for however as I use it multiple times through the day, I need the code to insert the right number of rows, copy it over to the email then automatically delete the rows it has just inserted so it is back to basics so I can use it again.

The code I have for the inserting the rows (from searching through forums) is:

Sub PRows()
Dim NextRow As Long
Dim NrOfCopies As Long
Dim i As Long
Const NrOfCopiesDefault = 1
Const NrOfCopiesMaximum = 9

[code]....

View 1 Replies View Related

VBA Script In Excel To Prompt User To Input Date?

Sep 15, 2014

I have a cell (C16) that has a date format (such as 08/28/2014). I want the value of this cell to be "N/A" when cell C7 is "No". When C7 is "Yes", I want Excel to prompt the user to enter a date for C16 when they click on C16. The formula for cell C7 is =IF(C3="No","No","Yes"). That's where the value of C7="No" comes from. If I didn't need a date for the value of C16, the formula would be something like =IF(C7="No","N/A","______"). I have just recently started trying Excel macros due to a tool

View 9 Replies View Related

Excel 2007 :: Data Validation Based On User Input?

May 24, 2012

In the spreadsheet shown below I would like the user to select a project via a dropdown list in cell B2 which is from the data set shown in row 7 downwards. Then based on the project they select, they need to be able to see all of the locations associated with that project and choose in B3. Finally they then need to be able to select a team which is associated with the project & location combination chosen in cells B2 and B3.

Excel 2007
ABC2
Project3Location4Team56ProjectLocationTeam7Project 1PerthTeam 18Project 1MelbourneTeam 29
Project 1SydneyTeam 110Project 1Brisbane Team 111Project 1Brisbane Team 312Project 1DarwinTeam 413
Project 1DarwinTeam 514Project 2PerthTeam 315Project 2PerthTeam 416Project 2MelbourneTeam 117
Project 2MelbourneTeam 218Project 2SydneyTeam 419Project 2Brisbane Team 6

View 9 Replies View Related

Excel - Hide Rows Depending On Values

Sep 12, 2013

I have created an excel document with If formulas. If nothing gets entered in that particular row, the row simply says "None". Is there a way to get rid of any row that contains that value by any chance?

Something along the lines of if the row says "None" then that particular row gets automatically hidden? It would probably need to be in VBA?

View 9 Replies View Related

Prevent The User From Saving The Data Input From The User Form If Any Of Those Three Fields Is Left Blank

Feb 9, 2010

I have a user form that has a combo box "City" two text boxes one called "Flight" and the other "Date". What I'm trying to do is to prevent the user from saving the data input from the user form if any of those three fields is left blank. The code that I have so far checks all of the required fields, if any are left blank a message notifys which field(s) is left blank and return the focus back to that field. But the rest of code also fires.

What I really need is either to stop the code if any fields are blank and return the focus back to the blank field, the user completes the field(s) and clicks the save again, or better yet, pause the code until all the required fields are completed and then complete the save. (There is actually another 200+ lines of code in this sub, but I deleted it to keep the post a little shorter.)

View 2 Replies View Related

Excel 2007 :: Combine Multiple Rows Into One

Jan 10, 2012

I have a list of about 4,000 contacts each with about 2 or 3 products with us. Each product creates a new contact row.

I would like to merge each row with the same contact into one row.

I have attached an example : Example test.xlsx‎

View 14 Replies View Related

Excel 2010 :: Combine Rows Of Data Into One Row

Mar 7, 2013

My business I work for is a collection agency and from time to time our clients send us files that are beyond recognizable for our collection software to understand nonetheless import into our database.

The file was a PDF at first but I have since been able to convert to excel format.

The data isn't too scrambled just scattered throughout rows. I would like to have rows of patient data into one row.

The file after being converted was all in row A but I have since used text to columns to divide into separate rows. However now one patient information is on multiple rows and I need each patient info on one row.

The file looks like:

|A---------|B-------|C----------|
1.John-----|Doe-----|123 Main St|
2.New York-|NY------|
3.11100----|SSN----|Balance Owed|

I would like the data from multiple rows to continue on row 1 like this:

|A--------|B-----|C------------|D----------|E--|F-----|G----|H-------------|
1.John----|Doe---|123 Main St.-|New York---|NY-|11100|SSN-|Balance Owed--|

I am no programmer in the least and have very little to no experience in pivot tables.

This file has about 7000 accounts with patient info spread through 3-4 rows for each set of data.

How I could go about doing this without manually copying and pasting into additional columns on the same row. That will take hours if not days.

View 2 Replies View Related

Check A User Input To See If The User Has Entered The Date Correctly

Feb 17, 2010

I am trying to check a user input to see if the user has entered the date correctly. I am using the code below but it keeps giving me a "Type Mismatch" error.

View 2 Replies View Related

Combine Two Tables Together?

Apr 1, 2013

I have:

- Table 1 has ~1,600 records (name of game, meta score, user score)
- Table 2 has ~3,000 records (name of game, genre, publisher)

I want:

- Table X has ~1,600 records (name of game, meta score, user score, genre, publisher)

Basically, I want to take the genre and publish columns from Table 2, and add it to Table 1. However, I want to ignore the extra ~1,400 games that Table 2 has.

I'm nearly a complete noob when it comes to excel. Noob to the point where I don't even know what this thing is called, so I don't even know how to search for it properly! I know something can be done since there is a common column between the two (name of game).

Edit: Also, I think it'd be easier if I were able to attach my excel spreadsheets but I don't even know how to do that

View 1 Replies View Related

Combine And Sum Rows Of Data In Excel Dependent On 3 Conditions?

Jan 3, 2014

I have a dataset that, due to the nature of how it is generated, separates certain orders into separate rows. Which orders these are is irrelevant, I just need a quick and easy way to make excel re-combine these rows in to one entry, and sum up the data in one particular column in the process of doing this.

The separate entries of a single order can be identified by the data in 3 columns matching - I have attached an example.

The constituent parts of the same order can be identified when the country, city, and code columns all have matching data as you read down. E.g., where

Country City Code
a 1 12345
a 1 12345
a 1 12345

Where this is the case, I want excel to automatically sum the count of shops for this order and then delete all but one of these rows, with the remaining row now containing this summed figure. Failing this, a new worksheet being generated/a new column giving me this data would be good.

View 6 Replies View Related

Combine And Sort Two Tables

Dec 1, 2009

I'm analyzing and charting performance data from two different boats. I am attempting find a way to combine the two charts into a single chart that is sorted by MPH as per my manually sorted example.

View 9 Replies View Related

Combine Tables From Different Worksheets In One Table

Jul 18, 2012

I have an excel workbook with 11 different worksheets. Each worksheet represents a project my company is working on. And in each worksheet there is exactly the same table, just with different data).

Now we would like to get an overview of all these different data put together in one 'summarizing' table on a new worksheet (number 12).

-Is it possible make such a table without having to copy past all the time?
-The data in the tables may change over time, so it would be good if that 'summarizing' table automatically adapts to the other ones.

View 9 Replies View Related

Combine Tables Deleting Duplicates

Aug 28, 2009

way to join two or more tables in excel adding new rows and columns.

In this way:

Input TABLE1
ID, Tag1, Tag2
1, alfa, big
2, delta, small

Input TABLE2
ID, Tag1, Tag3
2, delta, green
3, gamma, yellow

Output RESULTING TABLE
ID, Tag1, Tag2, Tag3
1, alfa, big, -
2, delta, small, green
3, gamma, -, yellow

View 9 Replies View Related

3 Different Tables - VLookup Depending On Selection From Dropdown

Jun 12, 2013

I have 3 different tables on a sheet which I want to do a vlookup on depending on the selection from a dropdown.

I created the ranges I want to use in 3 cells and tried to reference the cell rather than the range. Excel no likey:

=vlookup(B2,A1,2,FALSE) instead of =VLOOKUP(B2,D1:H14,2,FALSE)

Is there anyway I can do what I am trying to do?

View 2 Replies View Related

Nest / Combine 2 Sumproduct Functions From 2 Different Tables

Aug 20, 2014

Looking to nest or combine the following 2 functions because I'm looking up the same cell content, except within 2 different tables.

=IF(B12="","",SUMPRODUCT(--($B$12:$B$17=X18),--($S$12:$S$17))) and =IF(B22="","",SUMPRODUCT(--($B$22:$B$32=X18),--($S$22:$S$32)))

Right now, these functions works well from a single table but need to combine them. Other function examples are welecomed too.

View 6 Replies View Related







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