Entering, Formatting & Manipulating Data Using Macros
Apr 11, 2008
I would like to give credit and thanks to StephenR for producing the current Macros in use on this spreadsheet.
This was to sort out Raw Data that I get from a database, and with lots of help sort it and format so for a history of this you can look there.
Now I need to enter in some formulas, data from another spreadsheet and cell formatting…
Unsure if all this is possible but am hoping some of it is…
First Thing
The column Run Time has the data in them already this is the time in minutes am looking for a way to put a formula in, that will make them into hours so the formula will read like this “=180/60” this will give the number 3 as the whole number.
Second Thing
Using the whole number that the formula made in the Run Time column, am looking to fill cells with colour, too see what I mean here its best to take a look at my mock up spreadsheet.
Third Thing
Two rows below all the data that gets sorted out I would like to put in two totals, one for Run Time and another for Available Hrs “=SUM (Range)”
Forth Thing
I have data in another spreadsheet that is the Resrce Name, and Available hrs am looking to take that data from this spreadsheet that will be closed opened if needed, this data will assign workers to Work Centres.
I would like this to be a separate macro to run though all the sheets if possible.
View 14 Replies
ADVERTISEMENT
Mar 26, 2008
I'm working with a data logging system to collect data on a circuit. The logging software allows you to export the data collected to Excel in real time using DDE, and having talked to the logger company I managed to obtain a macro to get the data into excel (I'll put it at the end of the post). This works fine, and I can now press a button and Excel updates itself with the new data every second. What I want to do is quite complicated and I have no idea where to start:
1. The data obtained via the macro only displays in static cells, that is when the new data comes in it overwrites the old one. I want Excel to take a copy of each new bit of data as it comes in, and copy and paste it into a column on the same sheet so that it can be stored. I then want it to move down a row and take the next reading and so on, so that each time a new reading comes in, Excel takes the value and puts it in the next row down in a set column
2. Having a time elapsed measure would also be very useful, so that it records the time after starting the other macro in a column next to the ones collecting the data as described in 1. In this case, each new row would be 1 second further on. The actual time is not massively important, just the 'relative' time since the data collection started.
3. Once the data is copied into the columns to be stored (1.) I then want to calculate two sets of moving averages and place those in columns next to the data. My current plan is one average of 30 samples and another of 5.
4. Once I have the moving averages I can then get Excel to plot some graphs to show the progression of the two values
5. Since my project is revolving around detecting a short circuit in a coil of wire, it is looking for drops in resistance. I want Excel to be able to monitor the two calculated moving averages and if the difference between them exceeds a set threshold for more than 5 samples then some alarm is triggered (for now just a cell changing colour to red or a pop-up box or something).
View 12 Replies
View Related
Nov 24, 2008
I'm looking for a formula or code that would take a client's name that appears in one cell, with the last name first then a comma and then the first name, and paste it into another cell with the first name first and then the last name with no comma.
Example: cell A2 contains "Smith, Joseph", cell B2 should have "Joseph Smith". If I need to provide additional information,
View 9 Replies
View Related
Jan 25, 2007
I am working on a macro that opens up a workbook, formats the data by moving columns etc and then spits out the data to different workbooks according to a string in col R (M,C,S etc). I am able to split the file into the workbooks, but it copies the whole sheet and not just the visible cells (its working via a filter). I have tried adding code into the loop to basically copy the visible cells to Sheet2 and then delete (or clear) sheet1 so that I only have the relevant data but have very interesting. This is only the first of a few procedures I would like to add within the loop. Ideally I want to have a prompt for the filename and path for each file, and also another procedure to add a number into each seperate file. If I know why I cant get this simple function to run I will, hopefully, be able to add in the other bits!
Function SplitSheets()
On Error Resume Next
Dim ws As Worksheet, source As Range, dest As Range
Dim daily As Worksheet
Dim sType(4) As String
Dim i As Integer
Dim strSaveFileas As String
sType(1) = "M"
sType(2) = "S"
sType(3) = "C"
sType(4) = "N"
Set daily = Worksheets(1)
For i = 1 To 4...................
View 2 Replies
View Related
Jan 31, 2014
I'm putting together a workbook to keep track of income generated from Contractors (I work in recruitment). I have an existing system that displays margin, hours worked and income (margin * hours) but what I am looking for is a neater solution that would still have the margin column, but when hours are entered into a cell it is factored by the margin and displays income in the same cell.
So to be sure I am describing correctly, I am after a formula that will enable me to
1. Enter a value into a cell (for the hours worked - lets call this B1)
2. Multiplies this value by another cell (a fixed amount, the margin - lets call this A1)
3. Displays this result (B1 * A1) in cell B1, the same cell as the hours were entered in.
View 2 Replies
View Related
Mar 24, 2009
i need to pull data from one spread sheet and place it in a new spread sheet. and i am not that familiar with macros i am learning but i need to get this done.
View 13 Replies
View Related
Aug 8, 2007
I have a chart that I am trying to set up with dynamic data. I have the chart created, but the problem is that I will have a variable number of categories based on the data that is loaded, so I need to use VBA to change the range for the source data and labels on the fly (otherwise, I will end up with 20-50 categories that are all zeroes, putting a bunch of gobbledegook at the top of the chart).
What commands to I need to enter into VBA to get this to work?
I have put a formula in 2 cells to determine based on the current data what the source data values range should be, and what the category labels range should be.
The cell that holds the value range is Graphics!L6, and the cell that holds the labels range is Graphics!L7.
The current values that these cells hold are:
L6:
=Graphics!$J6:$J9
L7:
=Graphics!$K6:$K9
Oh, and the name of the chart is "Chart 1"
What do I need to put into VBA to get the chart to change the data source values and category labels to the ranges I have listed in those 2 cells? (and for that matter, have I listed the ranges correctly in those 2 cells so that they are usable?)
If possible, I would prefer to do this without having to use code to select the chart, because I want the updates to the chart to be invisible to the user.
View 9 Replies
View Related
Jul 25, 2006
I have a cell (A1) that, depending on a choice made elsewhere in the workbook, will return A2, A3, A4, or A5, which are all formatted differently with superscripts. How do I get that formatting to copy over to A1 without having to manually copy and paste format from the appropriate cell? I have to do this for a range of cells (A1:A15) instead of simply one.
View 4 Replies
View Related
Jul 4, 2008
I have only recently started playing around with macros, and am slowly getting into them. I do however still struggle a bit to ‘read’ them. Having played with formulas for years I can generally translate a string of formula text into English, like ‘if this cell value is greater than that cell value, then do this, if it is not then if it is equal to that cell value, do that, if not return 0’. Babbling like a child basically.
With visual basic I have managed to record some handy macros and then tweak them a little manually but I am still struggling to follow it going through it step by step reading it like a formula. So I hope you won’t mind me asking some very stupid questions. I mean well; I’m just a bit slow.
At present I am trying to do two different things on two different sheets, and I was wondering if perhaps one of you could nudge me in the right direction.
1:
I am trying to insert a blank row above every row that has a certain word in column B.
So basically ‘find value “Example” in column B, and when you find it, insert an entirely blank row directly above it’.
2:
Is a bit more challenging. I want to change the colour of a cell if the value in the cell corresponds with the value of another cell in the same column.
For example, I have a long list of surnames in column A. When I add ‘McNeil’ at the bottom, I would like to be able to run a macro that checks if the name McNeil appears anywhere else in column A, and if it does, that it changes the colour of the cell.
Preferably both of the cells that say McNeil, but one would do very nicely indeed.
If that is possible, I wonder if it is possible to do the same with the first name in column B, but only if there was a match for the surname in column A on the same row. So, if McNeil does not appear in column A, don’t bother, but if it does, does the corresponding first name appear in column B?
If both of that is possible, the next step would obviously be if McNeil appears in column A (say twice, once in A123 and once in A678), do cells B123 and B678 match as well?
View 14 Replies
View Related
Oct 11, 2013
I am totally new to Macros. I need a Macro which should format a column based on the value of another column.
Consider I have 10 rows. I have to format column D, based on the value of Column E. If the value of Column E is > 1000, then the background color of Column D should be changed as green. The most important requirement is Column E should be invisible, Changing the font color of Column E as White does not seem ok cuz when we select the sheet entirely using Ctrl+A, the white values are very much visible. Can this be achieved using a macro?
View 9 Replies
View Related
Aug 19, 2009
I'm building a database which I intend to upload to an ecommerce website. I am retrieving information on some of our products from the manufacturer's website. The information appears on the manufacturer's website as follows:
Part No : DP9970
* Description : Disc Pads
* Manufacturer : Trupart
* Unit Of Sale : Boxed Set
* Width (mm): 130
* Height (mm): 62
* Thickness (mm): 19
* Note: 4 pads with top clip
When I copy and paste this info into excel, it gives each individual line of information a separate cell. I need the information to appear in one cell in order for it to display properly on my website.
View 4 Replies
View Related
Aug 1, 2014
I have a list of number I want VBA to add to a sheet. right now i have a VBA to add it one by one but was wondering if there was an easier way.
EX.Range("A1").Select
ActiveCell.FormulaR1C1 = "78"
Range("A2").Select
ActiveCell.FormulaR1C1 = "275"
Range("A3").Select
ActiveCell.FormulaR1C1 = "280"
Range("A4").Select
ActiveCell.FormulaR1C1 = "765"
View 1 Replies
View Related
Mar 22, 2014
I am a beginner in VBA programming and I have to make a Userform for entering data in the specific places(in a table) in the worksheet. But when I enter a number, it changes all the cells to that number. I can't find my error.
View 7 Replies
View Related
May 19, 2009
I have two files which are attached.
One is the main report file "ops report.xls" and other is the raw file (Air.xlsx) from which data is to be added to this file. i manually take the data and enter it into the ops report everyday. This i want to automate as there are many such sheets to be completed (i have mentioned just "Air" sheet here in ops report).
Now what exactly i want to do is?
take data from Air.xlsx workbook as per the columns in the Air sheet in Ops report and paste it on that particular date row. this i will have to do everyday so the nest day the data will be pasted on next row against the date. The yellow columns which i have marked have formula so you need not touch that columns.
I nee to paste the average of Air sales and Air service. so we have to take average of row 43 and row 89 for first two columns in ops report. and then average of row 44 and row 90 for column L,N,O,P,Q in the ops report.
Afterwards the average of column J must be pasted in "Interval" sheet in ops report.
This is a bit tough but i know there are many genius people out there who can easily solve this.
View 10 Replies
View Related
Jan 5, 2007
Earlier this morning I had a telephone call from a customer who uses a spreadsheet I created.
She explained that once she'd entered information into a cell [and clicked elsewhere] she couldn't then add to the former; rather, she had to click on the cell and type it all out again.
I assumed that, as an inexperienced excel user, she was unware of either double-clicking the cell, or selecting and pressing F2. I explained these methods to her.
She later emailed me with this:
"Further to our phone conv this morning I have just tried double-clicking on cells but it deletes everything in the cell rather than lets you edit what is there – F2 does the same thing. This applies to any cell, whether it is text, date or number."
I've been using excel for a while now, and I've never come across such a thing before.
Has anyone else? Could it be to do with her own excel settings? (other customers have had no such problem)
View 9 Replies
View Related
Sep 24, 2007
I have the bellow code, I'd like enter the input on the next available row on column "A" instead than on "A2"
Dim strResponse1 As String
strResponse1 = InputBox("First Name", "Hey you !")
If strResponse1 = "" Then
MsgBox "You have chosen not to participate!", vbInformation, "What happened?"
Exit Sub
End If
Range("A2").Value = strResponse1
View 9 Replies
View Related
Jul 14, 2006
I have a basic script in VBA set up to enter standard information (street address in one block and city in another) on a website that has no fees or password requirements. If I step through the code using F8, this works great and the website returns the data for the address that was input from my excel sheet. However, when I assign this same macro to a control button on the excel sheet to get the code to run automatically, the website comes up to the default screen with nothing entered in either of the blanks. Again, when I just step through this, I get all the way to the output page on the website with the resulting data from my input data. For some reason, this does not happen using the same code connected to a button for automation purposes.
View 9 Replies
View Related
Aug 29, 2006
I have data pertaining to our fleet of trucks in 8 (1 for each plant)worksheets, sorted by truck number. I would like to enter a date (usually a monday) next to a truck number and then have the corresponding date plus 4 colored and/or have the truck # inserted on a calendar I have formatted in another worksheet with 31 columns and 12 rows.
View 2 Replies
View Related
Feb 2, 2014
I have a spreadsheet that records water consumption in L/s at 5 minute intervals. I've attached an example of the data collected during January 2012.
Is there any formula that will calculate the total amount of water consumed between a user-entered date range? For example:
From: 01/01/12 00:00 (User enters 'from date and time' in an allocated cell)
To: 20/01/12 23:55 (User enters 'to date and time' in an allocated cell)
Consumption: ______ (Formula generated result in Litres)
View 3 Replies
View Related
Jan 12, 2013
As I input data down a column in a wide Excel spreadsheet I would like to have highlighted the line I am working on as a check that I am in the correct place. I know that I can hit 'shift', 'space' for a single line, but is there a way to do it without having to hit those keystrokes each time?
View 2 Replies
View Related
Jan 25, 2013
I have two excel file name as A.xlsx and B.xlsx. Avoiding double work if I entering the production data in A.xlsx , need to automatically display the same data in B.xlsx. Let me know how the entered data in A.xlsx automatically display in another excel file B.xlsx.
View 1 Replies
View Related
Feb 27, 2014
I have a spreadsheet with multiple formulas in several columns - my staff will be using this spreadsheet to enter data throughout the year so it will be constantly touched by several users. Some of the columns are hidden, but I worry about someone sorting something funky or deleting or adding a row. Any way to protect the columns I have formulas in while still allowing them to enter data in the rest of the spreadsheet?
View 2 Replies
View Related
Feb 2, 2014
0: i have a sheet 1 protected and few edit range (Col A,B,C,D,E and F).
1: I have a validation on multiple adjacent columns (like Col A, Col C, Col E).
2: I need a code where if i select value in col a (cell A2) cell B2 should get current date and Time and both the cells (A2 and B2) should be locked. when i select data in cell C2 , D2 should get current date and time(Cell C2 and D2 should be protected).
3: User can enter data in A3 and B3 will get current date and Time (now A3 and B3) should be locked.
4: I need a function where user can call it and unlock the locked cells and edit the data and re-lock the cells again.
apart from the Col A,B,C,D,E and F, other columns and cells remain locked.
View 2 Replies
View Related
Jan 1, 1970
THis looks close to what I have been trying to find for months but what if I want to delete duplicates after pasting instead of making an error code? For instance, I have a list of names and addresses and I want to delete any entire row with a duplicate address.
View 9 Replies
View Related
Feb 10, 2012
I am trying to create a list of customer credits for my store. I have the person's name, the date of their credit, and the amount of the credit. This list will eventually be substantial and I would like to know how I can set it up so that when I open the worksheet I can enter new names from the top of the list and have the rest of the list shift downwards. This would stop me from having to scroll to the very bottom to add new info every time.
I would like to have it set up this way so that eventually I could put a search query at the top of the page (i'm thinking of rigging something up using vlookup) so that when my employees want to access the data base they can easily search a name and have the relevant info brought up, or can easily type in new store credits.
View 2 Replies
View Related
Mar 1, 2012
Having the cell protected after entering the data. From the below table, i need when a date is entered and moved to next cell, the cell which contains the data should be protected. I need to this for the comments column as well.
Number
DateStart timeEnd TimeActual Time takenComments
123459132546132156135469654814846543
View 1 Replies
View Related
Oct 4, 2007
Can I add something to a cell and have it so it does not print?
I need to mark certian cells to have data filled in, in those cells. However if data is not put in those cells I need them to be blank when printed.
Example:
I can put text in B7:
Enter Name Here
Then the user knows to put the name in that spot. If there is no name to be entered then I want to be sure that is not printed when I print the list.
Is any of this a possibility without putting 33 different labels on the page, which is one way. Or 33 different comments on the page, another way.
View 9 Replies
View Related
Aug 6, 2008
[code]...
Above is what I hav already, I was thinking it would help if each card had an additional field added that told you if the contents were valid. This could also say empty if all fields were blank. This field could for example use an if statement to check that you have entered a VS, a start date a project name. It could also check that if you have entered a completion date you also enter review loops. This could be in large red text so it is obvious to someone completing a card that they have not yet filled in all necessary data.
View 9 Replies
View Related
Aug 3, 2014
I have a spread sheet that is populated via a Userform. I have arrived at a problem where I don't know how to write the Code so as to Skip Column B i.e.
Column A Column B Column C Column D Column E Column F
Serial
ID
List of Activities
Owner
Environment
Planned
Start
Planned End
1
HQ DLC0001
Campaign Plan
HQ DLC
28-Feb-14
18-Jul-14
From the text Box I fill Serial, List of Activity, Owner Environment, Planned Start, Planned End.
Column B - ID - Is a unique ID that is created via a formula.
How can I add a line to the code below so that the User form skips Column B and only places the in putted data into Columns A, C, D, E and F.
VB:
Option Explicit
Dim id As Integer, i As Integer, j As Integer, flag As Boolean
Sub GetData()
[Code] ......
View 1 Replies
View Related
May 30, 2014
Working in Windows 8 excel. I am copying data from a website and entering that data onto a spread sheet. There are certain websites where the data does not transfer on the first try. It sometimes takes up to trying 3 times before the data will download onto the spread sheet. Why is that? And is there anything I can do to get it to transfer on the first try?
View 1 Replies
View Related