I have the following problem at work and been spending way too much time with it, I have four active tabs: "1","2',"3" and "summary" I would like to copy all data using the "usedrange" function from "1" and copy it into "summary". This works well until I want to do the same with tab "2" and paste it UNDER what I have already pasted in "summary". This is difficult as the data in "1","2" and "3" is continually updated and thus has no well defined range!
I have attached a portion of an excel file I am using at the moment. What I require is a piece of VBA code which will allow me to copy selected data based on a combo box selection. What needs to happen is this :-
If the selection in the "Index" worksheet combo box related to "Month" in cell G19 is for instance "December", I would like the macro to compare this cell value to the cell values in cells C96, C124, C152, C180, C209, C236, C263 and C290 in the "Tech Services" worksheet and where the values match.......copy the commentary (Range C126:Z147 in December's case) to the range C34:Z55.
On another worksheet, I have multiple comboboxes from the Controls toolbar in a column, each having possible selections are based on the data in a column 1 above (ie. A,B,C). When a selection is made in any of these comboboxes, cells to the right of the combobox get populated with the corresponding remaining data from the above cell range - ie. when A is selected, 1,2,3 appears to the right of the combobox, when B is selected, 4,5,6, etc. I want to be able to make selections from within combo boxes, not only by using the combo box dropdown and select mechanism, but also, if possible, by pasting a cell range whose data matches one of the existing selections available in the combobox definition. In other words, if I have a single column cell range from somewhere with the following data in 1 row:...............
I need a macro that can cut and paste a selection of 3 cells to a location one row above and 3 cells to the left. I want to run it each time manually from the right cell among the 3. the macro should therefore (when standing on the right cell of the 3):
1. select 2 more cells to the left 2. cut the selection 3. move 3 cells to the left and one cell up 4. paste 5. move the cursor back to the starting location
I have autofiltered a selection of data then issued the copy command in the code below so as to copy the visible area. In attempting to paste the data in the first blank row the program fails on the last code statement, "ActiveSheet.Paste".
The error is 1004.
An alternative suggested in the error message is to select an area the same shape and size as that being copied to paste into. Given that the copied data will change on each run how might I do this, and is this a valid alternative?
Selection.AutoFilter Selection.AutoFilter Field:=7, Criteria1:="=TC", Operator:=xlAnd Selection.AutoFilter Field:=2, Criteria1:=">=7330", Operator:=xlAnd Selection.SpecialCells(xlCellTypeVisible).Select Selection.Copy Range("A" & LR + 1).Select ActiveSheet.Paste NB. most of the code has been generated by the Macro recorder.
1) Select/Copy rows 1 thru 35 of column C from "Start" tab. 2) Special Paste/transpose them in row 2 of "Finish" tab (1st 35 columns in row 2 should fill up). 3) Go back to "Start" tab, move exactly three rows down from bottom of previous selection in column C and copy the next 35 rows (rows 38 thru 72 in column C). 4) Again return to "Finish" tab, and special paste/transpose in next row down (row 3 in this case). 5) Continue to repeat this action until all rows of data in column C have been copied and transposed/pasted from "Start" tab to "Finish" tab. Variable number of rows on "Start" tab.
I'm new to excel and VBA and I'm having problems with a copy paste macro that I’m using to transfer information from Sheet1 to sheet 3. The macro must:
On the click of a command button copy information from A5 to M5 and A6 to M6 and paste it to the next 2 free rows on sheet3 between columns A and M.
After the copy/paste the macro must clear the information from the input sheet - A5:M5 and A6:M6 - but retain the formatting.Thank You.
I'm working in a rather large (20meg) Excel file with multiple worksheets, references, formatting, etc.
Suddenly, when I attempt to Copy > Paste Special > Formats using more than a few cells at a time, I receive this error message...
"Selection is too large."
That's it - no reference, no nothing. Doesn't matter if I select a few cells, or entire rows, I get the same message everytime. However, I can copy-n-paste the entire 8000+ rows of data into a NEW file with no problems whatsoever. It handles everything - data, formatting, formulas, etc. But within my working file (same worksheet even) I get the error everytime.
I'm not using a macro. This file has worked fine for months. I'm doing absolutely nothing differently than ever before. This error literally just started today.
I know there is some issue with copy/paste of 8100+ non-contiguos cells, but I'm using contiguos cells. And again, I can copy nearly 10K entire rows of data and paste into a new workbook - just not within the same workbook and worksheet.
I've searched online - here, Mr.Excel, Microsoft, everywhere I can think of. Of all the problems I've found answers too, I have yet to find ANYTHING dealing with this problem - except in the context of a macro, which I am not using.
I have two sheets that I am using. sheet 2 has a list of experiments in column C with information regarding the experiment in columns F - J. On sheet 1 I have a dropdown box with a list of all the experiments. When I select an experiment from the dropdown box I would like to populate columns K - O on sheet 1 with the information from columns F - J for the selected experiment on sheet 2.
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
I have a workbook with two sheets. The idea behind the workbook is an Interview Guide to be used just before an Interview. For now my problem is this.
Sheet 2 "Competencies" is just data. It stores competencies with their associated definitions and questions.
Sheet 1 "Control Page" is the sheet where the questions will eventually go. The user (Interviewer) will input data on the first two pages which will include name of candidate, date of interview etc. but they will also select 5 Competencies from the already existing drop down menus on page two. From there as the selections are made I wish for a code to copy the corresponding definition on sheet 'Competencies" to cells lower down in sheet "Control page".
I don't see a place to upload a file as I have a sample of the sheet ready to go.
I would like to paste pictures from the clipboard to my workbook. Currently I'm using this piece of code to paste the picture, which works, however the cell need to be selected for this to work.
If a user selects certain options from a drop down list created by cell verification (from list), is it possible to display an input box and have the resulting input populate on another worksheet in the workbook? I have an attendance template I'm working with and if a user selects OT (Over Time) then a input box is displayed prompting for how many hours. The overtime is then tracked on another worksheet.
I tried very hard to design a leave roster for user to mark their leave application. The criteria are as follows:
1. 4 applications per date 2. a region of worksheet (i.e. "A2 to H20) will be defined for users to "click" on the cells (within the defined region) to mark their application. 3. once a cell is clicked (i.e. marked), it cannot be altered. 4. each click will automatically increase the total by 1.
I got the following code to deal with the situation but user can still click on any cell outside the region (in fact I fail to define the region).
Private Sub Worksheet_SelectionChange(ByVal Target As Range) Dim m ad = Mid(ActiveCell.Address, 2, 1) m = Range(ad & 24).Value 'here a formula "CountA(A2,A20)" will be place in the cell (24, c).......................
I am working on a project where user has to select an item from a listbox, however there is a condition that if user select an item, other items of listbox should be disabled so that he/she can not select any other item.
I want to have a drop down list in a cell so that the value in the cell can be only selected from two columns of data. Additionally once the data from the first column has been selected I want to be able to limit the inputs the user can select from in the second column.
e.g. In cell C115 I want to have the value BDS05.
I want to be able to select the value BDS from a drop down list of values and once that value has been selected I want to be able select 05 from a list of values from 01 to 14 If I select BCS as the first value then I want the second set of values to be limited to 01 to 02 etc.
I have read about combo boxes and list boxes and I'm a bit confused about the best way to achieve this (or even if I can).
Private Sub Worksheet_SelectionChange(ByVal Target As Range) col = ActiveCell.Column Range("output") = ActiveCell.Offset(0, -(col - 4)).Value End Sub
In case it's not obvious, the macro places the value in the active row and 4th column of the worksheet into the range "output". The problem is, the worksheet is large and somewhat slow to recalculate. This macro forces a recalc on any selection change, but i only need it to run when the row selection changes, not the column. I'm sure there's a straightforward way to reprogram this.
I'm trying to build an investment calculator. Tried searching "calculator" as keyword but return nothing similiar.
There are eight cell : [ A ][ B ][ C ][ D ][ E ][ F ][ G ][h]
[ H ] is price of the leverage
[A] is X balance [b] is X lot size [C] is X amount of money use to get x lot [D] is X percentage of money use to get x lot [E] is X point gain [f] is X money gain [G] is balance + money gain
Ignore the formulae for leverage to determine 1 lot price. Take 1 lot = 250.
What I'm looking for is when I enter any value at cell B, C or D, it will automatically calculate the value for either B, C or D cell.
Let say, the balance is 10000.
If I enter 2 at cell B. Then, it will calculate the value for cell C & D.
If I enter 750 at cell C, then it will calculate value for cell B & D.
If I enter 25 at cell D, it will calculate value for cell B & C.
How would you prevent the copy/paste of cells that have comments?
Also, how would you allow cells with comments to be copied and pasted without pasting the comments?
I also have an aside question about the forum advanced search. When searching for multiple search words, how would you type the search to include all words, for example, "prevent" & "paste" & "comments".
I would like to implement specific cell ranges from two specific worksheets each within 33 workbooks (which all have several tabs) into a summary page in a separate workbook.
The cell ranges are going across my spreadsheet in rows and I would like for them to transpose into a columns depending on the data which I have separated by catergory on the summary page. They are all on the same location in each workbook which is separated by country. The cell ranges are E26:P37 and I would like to transpose them and have them put below eachother without overwriting for my format on the summary page, how I can put this together in a macro?
Attached is my code, pay attention to the bold part. I want the sourceSheet to be copied as a sheet and pasted in the targetSheet (the Sheet2 of "NewBook") but I want it pasted asvalues. Here is the specific part which needs to be looked at...and below is the full code.
VB: Set sourceBook = Application.Workbooks.Open(sourceFilename) Set sourceSheet = sourceBook.Sheets("Current") Set targetSheet = NewBook.Sheets("Sheet2")
On the "Complete Backlog" tab of my workbook, I want users to enter in the requested information based on the column header. Then I would like a Macro attached to a button that says "Refresh" that the user would click after they have entered in all of the information. This macro should look in Column M (WIP Status) and if any of the cells say "Close", it should Cut the entire row from the spreadsheet(Ex. A2:M2) and Paste it into the speadsheet titled "Closed Jobs".
This is so that as jobs are closed/finished, they are removed and stored on a separate sheet. The items would have to be pasted so that it pastes into the next available row - not just on top of each other.
I also need another macro that i can put into a button that doesn't "delete" a row from the sheet, but just copies over to another sheet - so that there are two instances in the workbook.
If would look something like: If a cell in "Column G / Director" of the "Complete Backlog" speadsheet is equal to "Snodgress" then copy columns A-L of the same row to the spreadsheet titled "Snodgress" - of course skipping down the rows to the next blank row.
.....is equal to "Herr" copy row to "Herr" spreadsheet. ....is equal to "McCormick" copy row to "McCormick" spreadsheet. and so on.