Question and Answer
VBA Macro to make cell values change to have their SUM always equal 100
Submitted by kessepat on 10 February, 2015 - 02:00I have a series of numbers that I need to always sum to 100. I want a student to be able to change the values of these with a slider and have the macro update the remaining cells to always sum to 100. I have 6 cell see below example:
A: 25
B: 33
C: 22
D: 11
E: 4
F: 5
SUM= 100
*when the student changes A I want it to split the difference across the remaining cells so:
A: 20 (changed from 25)
B: 34
C: 23
D: 12
E: 5
F: 6
SUM= 100
I don't think this should be hard I just don't know how to write the macro part where I get the difference between A(state1) and A(state2)
DDE live prices
Submitted by stavros21 on 9 February, 2015 - 15:58Hi guys,
I have some prices updating in excel real time through DDE 24 hours a day. I want if possible to take the average of that prices per hour.
On attached sample B/C/D columns are updating from the MT4 platform. Column B is the time of the last update column C is the price and column D is the ASK price. Column E shows the spread which is ASK minus BID price. That i want is to have the average of Spread (column E) per hour. So column F will show me the average of column E between 00:00 and 01:00, column G between 01:00 and 02:00 and so on.
Vlookup or alternative in VBA
Submitted by hdean80 on 8 February, 2015 - 09:02I'm Having 2 files, master.xlsx and price.xlsx
whenever i'm changing in the master file, it have to replace in the price file, like Vlookup.
Eg: in the masterfile, ColumnA: Apple, ColumnB: 10.00.
in the price file, same as ColumnA: Apple, ColumnB: 10.00.
if i change the price of apple in master file, it have to replace in the price.xlsx
i'm having 10000 rows (currently using Vlookup formula, but it is getting slow my excel file), can anyone help me for in VBA coding..
- 1 comment
- 2355 reads
A huge data in a particular format in excel is to be added to database
Submitted by LearnerAnu on 8 February, 2015 - 05:58Hi,
I am new to coding and VBA. I have been assigned a part of the application we are designing for a client. I have been going through tutorials but am not able to pick the data from excel sheet which is present in a particular format and add to access database table with field names that are not same to excel. Though i have been successful in connecting the applications, but i am not able to create a proper loop.
I am attaching the format sheet . Kindly help me to add this excel data to access database. I have also put in the structure of my database in the file.
Kindly help.
Need Macro to pull data from list and create new worksheets for each result
Submitted by kingsdime29x on 6 February, 2015 - 16:23I am trying to modify a macro I have that will help me use the macro below to help me go through a list of players to pull all the data tables mentioned below into one worksheet per player and then move on to the next player with their stats on the next worksheet. Right now I am going through each player one by one with the macro below and takes a lot of time and trying to see if there is a quicker solution.
I have attached the list of players in the Excel file and then attached a notepad file of the query file that I used in Excel. Below is the code that I am currently using.
VBA Code for Autofill situation
Submitted by superiorsvc on 4 February, 2015 - 21:34In Column C I have what you see below. I want autofill so that the two blank cells under 12345 will fill with the same 12345 and so on for the entire sheet. The numbers do change as you go down the page as they do here. Every two or three or five blanks is a new number.
12345
45678
VBA Code
Submitted by superiorsvc on 4 February, 2015 - 21:32If Column A is not blank for that row - then I want to hide that entire row. Would like VBA code to do this for the whole sheet again. Range rows 1-36855.
- 1 comment
- 2665 reads
File disappeared.
Submitted by spoc_123 on 3 February, 2015 - 13:14Hello,
An excel file that I've worked on for several months has dissapeared.
I looked at it yesterday last, and today there is no trace left of it.
- not in temp folder
- checking hidden folders doesn't help
- tried looking for it using words I know it contains in case I accidentally saved it under another name, alas, to no avail...
When I tried to open it this morning I received an error saying that the shortcut to the file wasn't working (I was trying to access is through 'recent files') and did I want to delete the faulty shortcut? Probably I shouldn't have, but I said yes.
Help with creating invoice calculator with multiple drop down menus and functions
Submitted by excerbated123 on 3 February, 2015 - 05:34I'm pretty new at this and any help or direction is greatly appreciated.
So here's what I'm trying to do.
First you might wanna download my example file so you can follow along.
Looking at sheet 1 we have our first drop down; "category" in A4. I want to select an option there (Either Underlayment, Edge/Valley metal, Flashing, found on sheet 2) and have the next drop down (B4) automatically populate with different line items associated with their respective categories.
Take a look at sheet 2 and you'll know what I mean.
Problem copying and pasting
Submitted by rubensg on 1 February, 2015 - 19:49I'm trying to copy and paste a graph from Excel to a
word document but when I past the bar chart into word the bars disappear and
the axes change values. It seems like all of the original formatting is
lost. I haven't had this problem before so I'm not sure why it's suddenly
become an issue. Even when i copy and paste within the same spreadsheet in
Excel the formatting changes and the graph is ruined. Any help would be really appreciated!
Find return value from two subtracted assigned value of text string
Submitted by tiridako on 30 January, 2015 - 16:01Before I delve into the code, what I'm looking for is the number of times to use Tab key and Spacebar on the keyboard to check off a check box on a web form because not all will have all four example categories as listed below. Time is an issue, and I do not want to create 4 columns, one for each category and count each empty cell as a Tab, but condensed like the excel sheet below. There are 99 unique checkboxes to go thorugh, and usually no more than 10 will be checkbox'd off. I am unable to use `<input type="checkbox" ..
Automatically moving a row from one worksheet to another when date completed added
Submitted by ColinM on 30 January, 2015 - 11:08Hi All,
I am a mediocre Excel user who needs a bit of help. Worryingly my company thinks I'm good at Excel. The truth is the rest of them are just not even as good as me!
I am trying to revamp their project spreadsheet to be easier to complete. I have added some simple things like conditional formatting for RAG status, but what I would really love to do is find a way to automatically move a row out of the Open Projects worksheet when the 'Date Completed' field has a date added, and into the next free row in the Closed Projects worksheet.
- 2 comments
- Read more
- 1998 reads
create column in one sheet based on value in another sheet and copy data to new column
Submitted by trident50 on 29 January, 2015 - 18:43Hello,
I'm running Excel 2013 and I have one workbook with two sheets - sheet1 and sheet2. Sheet1 has 24 columns and 26K rows. Column "A" is titled "id" and contains
id numbers that are also, some, found in column "A" of Sheet2 - which is also titled "id".
Sheet1 has no "description" column. Sheet 2 only has 2 columns - "A" is the "id" column and "b" is the "description" column.
A B
ID Description
58749651 a bunch of text
multible tabs
Submitted by tareq on 29 January, 2015 - 07:56i have a sheet with multiple tabs, each tab is for one currency .
on daily basis i receive an excel sheet with the daily prices which i should fill the prices from the newsletter to my sheet .
is there anyway i can make it automatically take values from the newsletter to my sheet ?
How to get data like CTRL+F, but query another spreadsheet
Submitted by robplantikow on 27 January, 2015 - 21:43I have a large spreadsheet with many tabs that I want to keep in a secure location. I want to be able to query it, essentiallly exactly the way CTRL+F does, when set to "entire workbook", to be able to find cells that contain the search key, with a report out that shows at least the tab name. So, is there a way to CTRL+F but to apply it to a completely different workbook?
looking for a formula
Submitted by jblaser on 27 January, 2015 - 16:19Hi
I am trying to capture in a excel formula the follwing:
if A1+A2 =100% and A1 > 50%, allocate 10 point
if A1+A2= 100% and A2 > 50% allocate 9
if A1+A2>75%<100% and A1> 50% allocate 8 Points
if A1+ A2>75%<100% and A2> 50% allocate 7 points
if A1+ A2> 50%<75% and A1 > 50% allocate 6 points
(A1 and A2 are cell values expressed in %)
Grateful for any tipp you might be able to give me what type of formula I could use.
Best
Jerry
- 1 comment
- 2128 reads
macro for copying data from one sheet to another
Submitted by kssrb on 26 January, 2015 - 20:53Hello,
I am working on a macro to copy data from one sheet to another. There are four sheets on a workbook. I have "if condition" mentioned on column H of first sheet called Spreadsheet. If the condition is met it answers yes. I want to write a macro to copy rows A:E from sheet called Spreadsheet to sheet called Exception if condition on column H is met and it answers "yes" in column H of Spreadsheet. Data should be copied on cell A2 on Exceptions sheet. Here is what i have so far but it is not working. Please help. Thanks in advance for your time and help.
Sub CopyRowsAcross()
Count number of cells that are between certain percentages
Submitted by Krystal.Gayle on 22 January, 2015 - 23:38I have attached a spreadsheet.
I need a formula to count the number of students from each school, in each grade, that are between 90-100%, 80-89%, 70-79%, and below 70%
So for example, there are 9 students in Grade 1 at the community school that are between 90-100% and 7 that are at 70-79%.
Please help, I have 25 schools and it's horrendous to count them.
Thank you so much
- 7 comments
- 2860 reads
Excel - Multiple Text criterias needing one text result
Submitted by dusting8 on 21 January, 2015 - 21:07I'm looking to do a formula and cannot seem to find any help online. Everything I found returns a specific word or number specified by "".
I have a scenerio that needs to put specific text (from a drop down box) into another cell ONLY if a cell that refers to that cell says "Yes"(also chosen from a drop down box. Below is an example.
Team A. Team B. Team C.
Yes. No. No
Cell E4 NEEDS TO SAY: Team A
Because it was the only option that has Yes in the cell below it.
Will Formula work or do I need VB code when considering values from cells located in various locations?
Submitted by tomdecicco74@ya... on 21 January, 2015 - 17:59I’m trying to find the same FA-Driver associated with different project numbers that and their combined Amounts are greater than zero.
I am basically keying in on three columns I call FA-Driver, Project No, Amount,
The sheet is sorted on FA-Driver, and Project No and sometimes I will have duplicate driver-fa values in succession but not always. They are not all duplicates.
I need to check if I do have more than 1 of the same FA-Driver amounts, with different project numbers associated and where the combined amounts associated with them are greater than zero and flag them.
Drag a formula that draws from multiple rows (see attached link for context)
Submitted by dempa110 on 21 January, 2015 - 11:13Hi there everyone. I'm not an excel whiz but really stuck on this one and hoping a guru out there will be able to help me out as it's really important for some research I am doing - please!! I think it will be quite a simple fix (see attached example excel sheet for context below). If you are even able to modify the formula in question and re-attach that would be awesome too!!
Extracting unique results from multiple column combination
Submitted by kedardkulkarni on 20 January, 2015 - 21:27Hi Experts,
Please refer to the attached sheet. The data contains three columns Col 1, Col 2 and Col 3. Ignore Col 1.
Col 2 and Col 3 share a parent-child many-many relation as an example aa-a, aa-b, bb-a and so forth. The intent is to consolidate unique combinations of parent-child on a separate sheet with the parent displayed as a rolled-up row. Further, a third column which can be entered by the user is also present that has allocations (essentially percentages) and the sum of the children should roll up into the parent row with a validation of a maximum of 100%.
Using Index Match with multiple criteria
Submitted by jessicakorynta on 20 January, 2015 - 20:07I am trying to use excel to pull data from 1 sheet to another based on if a student has paid an exam fee or not. Looking at the first sheet, I want G2 to determine if the student listed in A2 has paid for the exam listed in G1 by looking at the "Test Data" sheet. I had tried doing a INDEX, MATCH with multiple criteria but it didn't pull the correct result.
Here was my initial formula:
=INDEX('Test data'!A2:E986,MATCH(1,('Test data'!A1:A985='Student Reg & Exam Orders'!A2)*('Test data'!C1:C985='Student Reg & Exam Orders'!G1),0),5)
Create Excel document with rows of differing column widths
Submitted by joeponcho on 20 January, 2015 - 00:42Could anyone tell me how to create an Excel Document that has rows of differing lengths? For example,
Line 1: Date____________ State of xxxxx Time __________________
(the underlined area is where the user would enter their info &
the "Date" "State" and "Time" would be protected.)
Line 2: Name:___________ Number: ______________ Offense____________
(again the "Name" "Number" and "Offense" would be protected & the
underlined area would be entered by the user)
So Line 1 is 5 columns or elements and line 2 is 6 columns or elements...
copy and paste based on criteria
Submitted by ezonemy on 19 January, 2015 - 06:22hi i have a workbook which contains 2 sheet.
Sheet 1= this is master sheet
Sheet 2= contains list of item(row 9 till 155), each row is different item, staff required to key in amount for that item at column F. Column I contains "defined name" for each item (e.g A9 is item named Admin, F9 is where amount is keyed in and I9 named as item_1).
Require vba code to perform the below;
a) In sheet 2, hide rows from A9 till A155 based on value in column F. (e.g. if F10 is empty, the whole row need to be hidden)
Run Macro from External Trigger via USB Port
Submitted by NickW000 on 19 January, 2015 - 03:59I have an Excel spreadsheet used for timing motorsport events. A macro is triggered by clicking a Button; this macro basically records the current time of day and asks the user to identify the car. The spreadsheet builds up a database of the times that each car passes a certain point. Other macros extract, manipulate and display relevant data about each car's performance. I want to modernise the application by adding a beam to send a signal through a USB (preferably) or other port to trigger the macro to start whenever the beam is broken.
(Vba) Simple Copy & Paste of ranges ,but with random values
Submitted by deyneitz on 18 January, 2015 - 22:06I cannt understand, why my excel script does not work anymore.. I need to do simple copy Paste function,
First, I have 1 value (Mean) which is generated and it changes randomly after any action (Very important point!)
So , I need a kind of "simulation", means to copy the value and put it in another worksheet, after that the excel is refreshing automatically and I get a new mean-value..
This process should be repeated 1000 times. It means i will have 1000 different values at the end, because of random changes of my mean-value
I have a script, which works perfect for this purpose.
How can I forecat
Submitted by Topdealz on 18 January, 2015 - 12:31Hi I have a problem and I ma afraid that my math skills has deserted me.
As per the attached exell sheet I want to try and forecast percentage wise what the next no in Cell A84 might be.
In C1 - 4 is the amount of times a no appeared in the worksheet
D1 -4 is the percentage times a certain no appeared on the sheet
E3 is the percentage times 1 ,2 and 3 appeared on the sheet.
What I want to try and forecast is 1. what is the chances % of a 1 to appear in A84
2. what is the chances % on either a 1 , 2, or 3 to appear in A84
3. what is the chance % of a 0 to appear on A84
Auto sum formula next to particular text
Submitted by Anmol786 on 17 January, 2015 - 14:30Can it be done thr VBA or EXCEL
plz tell me
if i write SUBTOTAL in A3 the sum total of given range is auto done in B3
if i do that B5 then sum total should be in C5
a file is attached here
plz help me
Error 1004 with macro to Insert>object>Create from file>Browse
Submitted by Ejacobsen on 17 January, 2015 - 11:55Hello Experts.
I am currently experiencing difficulties with my macro to insert embedded files, such as PDF's.
I found the macro in another forum, and it acutally Works perfectly. I've assigned it to a button, and whenever i hit the button, the browse window turns up. There is just one exception. If i cancel the browse window, instead of actually inserting the file, i get the error 1004 mentioned in subject.
This is how my macro looks like.
Sub Macro1()
'declare a variable to hold the file name:'
Dim FName As String

Recent comments
6 years 9 weeks ago
6 years 47 weeks ago
7 years 7 weeks ago
7 years 9 weeks ago
7 years 11 weeks ago
7 years 16 weeks ago
7 years 24 weeks ago
7 years 25 weeks ago
7 years 25 weeks ago
7 years 25 weeks ago