Using A Combobox Without Overwriting Existing Data
Oct 9, 2008
I have a worksheet containing employee information (i.e. name, manager, department, etc.). I also have a userform that will be used to make changes to the employee information. The userform has three comboboxes and, when activated, the userform is populated with the existing data in the worksheet.
Here is the problem - I need to have the existing worksheet data populate (as it does now) but also have the combobox choices available in the event that one of the 'combo' fields need to be changed. How do I keep the existing worksheet data AND keep the functionality of the combobox?
View 3 Replies
ADVERTISEMENT
Sep 5, 2013
- Construct a macro to import a csv-file to my worksheet named "Info". The data in the .csv-file should start in row A5 in my worksheet.
- If the worksheet "Info" already has data, I want to overwrite the existing data with the new data starting in row A5
The directory of the csv-file is C:Testmycsvfile.csv
View 3 Replies
View Related
Jan 19, 2008
I need to create a macro that will insert copied cells(cell range) from the clipboard into a cell on a different workbook and "shift cells down". The cell range in the clipboard will always be different and the position of the cell I select to insert the data into will also vary.
View 4 Replies
View Related
Aug 11, 2014
I have a large spreadsheet which I have extracted the data I need, but I am now having a problem tiding it up.
To simplify. I have 2 columns, both containing data formatted as text, each column has some data, but on different rows.
I need to merge the 2 columns without overwriting the data on the second column, with blank data from the first column, and without the column shrinking or growing.
Here is a section of my spreadsheet that needs merging : Excel-1.PNG
I have tried copy > Paste Special > Skip Blanks, but it just copies the column to the other - no merging.
View 1 Replies
View Related
Aug 12, 2008
I am working on multiple sheets that collate to an “averages” sheet. The Averages sheet would need to collate the information historically.
I need a code that can be assigned to a button so when it’s clicked, the figures for this week are added to the figures that were from last week. So for example.
Worksheet 10, Rows 12 – 20 have the data from the last 8 weeks.
Worksheet 09 has this weeks data and a button to push. When pushed it adds the data from this week to row 21 in Worksheet 10.
The following week the button would add the data to row 22 and so on.
Essentially each time the button is pressed it drops the information in a row one lower than the last time the button was pressed.
View 9 Replies
View Related
Jan 24, 2012
I will copy a report into sheet 1, starting in the same place(A1), on a weekly basis. The headers are: Item, Quantity & Price
Week 1's report shows the following:
Windows 5 $1.00
Doors 6 $1.50
Chairs 7 $2.00
Week 2's report shows the following:
Windows 3 $1.00 (change in quantity)
Tables 7 $5.00 (new item)
Chairs 7 $2.50 (change in price)
I need to have a rolling, unique list on Sheet 2 that will do the following:
- add new line items
- keep old line items while checking to see if the quantity or price has changed.
Therefore, after week 2's report is pasted on sheet 1, Sheet 2 should look like this:
Windows 3 $1.00
Doors 6 $1.50
Chairs 7 $2.50
Tables 7 $5.00
Here's the most important part: There will be formulas in Column D in Sheet 2 that I need to stay with each item. generating the desired result on Sheet 2!
View 9 Replies
View Related
May 9, 2013
I have amended the code below and have got it working. The problem I have now is that every time it loops it overwrites the data it wrote the previous loop
Offending line being ActiveSheet. Range ("A1: D30") = ValuesArray
I have known that somehow it should remember the last row and copy below this one but I cannot get it to work
Code:
Sub Basic_Example_1()
Dim MyPath As String, FilesInPath As String
Dim MyFiles() As String
Dim SourceRcount As Long, Fnum As Long
Dim mybook As Workbook, BaseWks As Worksheet
Dim sourceRange As Range, destrange As Range
[Code] ..........
View 1 Replies
View Related
Feb 17, 2014
I have a worksheet that has macro events attached to command buttons. When a ‘Start’ command button is clicked, a timer begins counting in seconds and displays the value in cell B3 until a ‘Stop’ command button is clicked. The event works flawlessly as long as I don’t open up another workbook (to continue working in Excel).
When the second workbook is open…then time stops working in the workbook where the macro was created…and starts displaying the ‘timer count in seconds’ in the new active workbook--which overwrites/destroys the data in the newly opened workbook. When I go back to the original book that called the macro…it continues counting again.
I need this timer to continue running in the workbook with the command buttons (in the background) while I work on other worksheets in other books. Is there a way to keep the timer running no matter how many other workbooks are opened and prevent it from overwriting whatever sheet is active? This code in the Increment Sub below ‘overwrites’ the contents of cell B3 on whatever sheet is active---and stops the timer in the on the sheet with the ‘Start’ command button.
View 1 Replies
View Related
Sep 19, 2012
I have a copy and paste macro below, that copies the selected rows and pastes them into a different sheet called Blank BOM. Each time they are pasted, it just writes over the previous items at the top of the list. I would like it to paste in the next open row, so I can go back and forth between the sheets and add things. Here is the code:
VB:
Sub CopyRow()
Selection.Copy Sheets("Blank BOM").Cells(Rows.Count, 1).End(xlUp).Offset(1, 0)
End Sub
View 9 Replies
View Related
Jan 30, 2013
I'm linking my excel document to a table on the web. The source only ever shows the last 50 orders but I would like to retain the old data when refreshing so I can see further than just the last 50 transactions. Is there any way for excel to insert rows for any new data? All the options when linking to the source seem to clear the old data.
The table looks something like this:
Timestamp OrderID Description Filled
View 1 Replies
View Related
Mar 30, 2014
I need to populate two combo boxes from excel sheet, the data will be like below:
Column A Column B
A 1
A 2
A 3
A 4
A 5
B 100
B 101
B 102
So from the above data, one combo box should hold unique values A & B.
On selecting a value from the 1st combo box A or B, respective values should be populated in 2nd combo box.
So the data should be like below:
If A is selected in the 1st combo box, then 2nd combo box should only show the values 1,2,3,4 & 5.
If B is selected in the 1st combo box, then 2nd combo box should only show the values 100,101 & 102.
Friends I need it in a macro and one important point is, this is dynamic and it is not static and the data can be more.
View 1 Replies
View Related
Jan 29, 2013
I am trying to create a user form that will allow the user to type int values in boxes. Then when the user clicks the submit button the code needs to add the values from each user input box to the existing values in specific cells accross multiple worksheets. Then the form needs to be cleared after the cell values are updated. I can create the form it is the code on the submit button i am lost on. Also it is important that some boxes may be left blank.
If you click the Grey "Qty Form" button on sheet1 the form will open. User data numbers can be entered in the blank boxes. When the submit button is pressed the form needs to add the user entered numbers to the numbers in the corresponding cells in sheet 1 and sheet 2. How to code the submit button to do this properly. Also after the data on the spreadsheet is updated the form needs to be cleared and start the cursor back in the Item 1 box on the form.
View 1 Replies
View Related
Oct 18, 2013
I have been working on a macro that compares a existing list of data to an updated list of data and then either moves any data not on the new list over to a completed tab (followed by deleting the record on the existing sheet), and then adds any items not on the existing sheet, but which appear on the new list, to the existing list.
I have come across a stumbling block, i have managed to identify on the existing list the rows of data that have been removed from the new list and therefore need to be moved over to the completed tab, but when i select the data it selects the header row aswell (which will always remain the same row). Obviously this then pastes the header row aswell, and also i can't seem to get it to paste in the new sheet to the next available row (i.e this will be used daily and i don't won't to overwrite the infor already in the completed tab). the next issue i have is then when i go back to existing sheet to delete the data i just copied across, as the header was initially select this also gets deleted.
The code below, is the complete code, including filtering, copying some forumals etc. The area i am getting stuck on is highlighted in red:
Sub Update()
Dim bottomrow As Long
Dim My_Range As Range
bottomrow = Cells(Rows.Count, "C").End(xlUp).Row
Set My_Range = Range("A1:Y" & bottomrow)
[Code] .....
View 6 Replies
View Related
Mar 21, 2014
I have a range of weekly data that I need to copy into another workbook, paste it below the data that already exists there and then delete the data from the original workbook. I would love to do this with vba but after hours of searching on how to do this my brain is frazzled.
I have 50 workbooks that I need to import weekly into one master sheet (Master.xlsm) but they need to be done individually after the weekly data has been checked. The master sheet will therefore have existing data and the new data needs to be appended at the bottom. Also column A will be blank in both workbooks so to find the last used row it will need to look in column B.
The number of rows in the weekly sheet will also vary rather than be a fixed range so I guess the last used row will also need to be found there too.
The attached file is a cut down version of my working file showing where the data starts on Row 14, I won't need to copy the headings.
Example file 21.03.xlsm‎
View 4 Replies
View Related
Feb 12, 2014
getting data externally from web and also keeping the previous data prior to the refresh.
My external table/data has 10 rows reporting values per day (10 days data table).
I can link the table to my sheet, however what I can not do is to create an offlinek, year to date table in the sheet which captures the rolling 10 days (everytime it is refreshed) without losing the prior days.
For ex:
External bank Data
Day Ratio
02/05/2014 0.15%
02/04/2014 0.13%
02/03/2014 0.14%
01-31-2014 0.23%
01-30-2014 0.16%
01-29-2014 0.16%
01-28-2014 0.18%
01-27-2014 0.19%
01-24-2014 0.19%
01-23-2014 0.21%
Above table changes on a daily basis, only reporting the last ten days.
How can I capture this data on a rolling basis, i.e. in a year to date format, so that everytime I refresh, the internal table gets updated with the new data.
View 3 Replies
View Related
Jan 3, 2008
I'm trying to move data from a primitive user form to another sheet acting as a DB. I will further pivot the data in a third sheet to boil up results.
Here is the primitive user form - or desired data from the user form: ...
View 9 Replies
View Related
Feb 5, 2007
cell A3 contains a drop down list of student names.
say, William is the 1st student listed on cell A1.
when William is selected his math grade shows up on cell B3 & his English grade on cell C3
I figured out how to make cells B3 & C3 change according to selected student from cell A3. All data comes from the Database Table, which is locked/unedittable.
Here is how my sheet looks like ....
View 14 Replies
View Related
Aug 1, 2014
I have many rows of data 6 columns wide. I want to be able to enter data into a specific section, then run a macro to "cut-and-paste" that data onto the bottom of my existing data (with one empty spacer row between the new and existing data)
Here's what I have so far:
[Code] ....
Basically the part I need working on is changing [ Range("A101:F130").Value ] to be dynamic. For the code to determine the last row of data, move 2 rows down, and paste the block there.
View 6 Replies
View Related
Sep 11, 2012
Each day I copy paste data onto a sheet (below the prior days copy paste). What's a simple code to automate this? I want to keep all prior day data and just paste into the first blank row
View 3 Replies
View Related
Aug 5, 2013
I am trying to add data to an existing chart with VBA. I have defined and populated my arrays, but I m not sure how to add them to graph. I am getting a Invalid proedure or call argument on the code below.
Code:
Sub Plotting()
Xvalues(1) = 50
Xvalues(2) = 48
Xvalues(3) = 46
Xvalues(4) = 44
Xvalues(5) = 42
Xvalues(6) = 40
Xvalues(7) = 38
Xvalues(8) = 36
[code]....
View 1 Replies
View Related
Dec 11, 2006
I have the following macro which:
- opens a database checks each sheet in the database for a contract number,
- highlights the row in which it finds the contract and updates the database with claim number etc (not important)
- returns information to another sheet from the database
The macro works fine BUT I have recently realised that if the contract has already been paid out it will simple overwrite the information and I will not be aware that the contract had already been paid out.
I need the macro to return a value of "Already claimed" instead of "Found in Database" only if the contract number has already been updated.
Sub DataBaseCheck()
' Designed to check Database for claims issued each month
' Open Data Base file to facilitate matching process.
' Check for matching data
' Return checking data to spreadsheet & Update Database
Dim currentfile As String
Dim WS As Worksheet
Dim R As Range
Dim Myvalue As String
Dim Myrange As Range
Dim Tcell As Range
View 9 Replies
View Related
Jul 2, 2012
Clicking the Add to DB button will add new items but not existing one.
now, what I want to do is to first, populate the existing TIN and then do the necessary update.
my basis for update is txtTIN.value
Here are the codes anyway:
VB:
'This adds the data on the WorkSheet named DBPIT"
Private Sub cmdAdd_Click()
Dim iRow As Long
[Code].....
View 5 Replies
View Related
Dec 4, 2013
I need a formula to check if anyone from the Old employee col(B) exist in current employee column(A).
A B
Current employees Old employees
A C
B G
C T
D
E
F
G
View 2 Replies
View Related
Jun 1, 2013
I have the below code that copies and pastes from one part of a spreadsheet to another. I need to modify it so that it does not over-write the information where it pastes to, but rather adds the new information to the lines below the data that is already there.
Private Sub PlaceData_Click()
Range("A7:C23").Select
Selection.Copy
Range("G4").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
[code]....
View 3 Replies
View Related
May 2, 2007
need to add same data to every other existing cell in the column, but not replace the data already in it, but to add to it. I've tried to google the answer and look here, but I probably use bad search terms.
For example, I need to add "QW" after each of these lines:
data1432
data9292
data3933
data3939
so it would look like this:
data1432QW
data9292QW
data3933QW
data3939QW
I have a few thousand rows of data, so wouldn't rather not do it manually cell by cell by typing :-)
View 9 Replies
View Related
Sep 28, 2009
I don't know how else to ask this so I will just tell you what I'm trying to do.
-I have a list of name on one column say "A"
and this list of names goes through "A1" through "A145"
-I am taking those names and pasting them via "right click" "paste special"
"Values" onto another spreadsheet.
-BUT I have to take each name one by one and paste them evenly
in every 8th row for example ( "A1" A8" "A16" "A24" ...)
-Is there a way to take the existing data on that row and just spread it evenly throughout the same row? So I don't have to take names one by one by one...
View 9 Replies
View Related
Mar 14, 2013
I have 2 sheets similar to below :
Sheet1
apple pc
sony camera
lenovotablet
apple laptop
Sheet2
sony television
lenovopc
I need to compare Column A from Sheet2 with Sheet1 and where the values match, only replace THOSE values in Column B of Sheet1 with those in Column B of Sheet2. Hence, after the replacement, Sheet1 should look like (value for apple remains unchanged).
apple pc
sony television
lenovopc
apple laptop
What would be a formula that would do it ?
View 1 Replies
View Related
Apr 16, 2013
I have this sheet, which is just an example (the actual one has many more records).
subset.xlsx
I received this sheet (again, example)...
new.xlsx
I need to add the new sheet to the old sheet, so that they are merged into one sheet. Also, if the same "LOC" appears in both sheets, I need to overwrite all the records for that "LOC" in the old sheet with the records from the new sheet.
View 3 Replies
View Related
Apr 22, 2014
My code is working with respect to finding the right data, but it keeps overwriting itself on each loop through...I need it to copy/paste and then on the next loop, move down one cell...
[Code] .......
View 1 Replies
View Related
May 14, 2009
Perhaps, this question is much more related to Windows API but I thought of posting it here incase I get some more ideas.
I am looking forward to develop a program wherein I can prevent or avoid an Excel file being overwritten by a different file with the same name in the same location in windows explorer.
After a rapid search on the internet I have got something which I could use but that would just serve me the purpose of retreiving the overwritten file in windows explorer.
View 9 Replies
View Related