Copying Cells With A Macro
Oct 10, 2009
I would like to copy a range of cells with a marcro, for example copying range C3:C15 over to D3:D15 and when I run the macro again I want range D3:D15 to copy to E3:E15 and from there to copy E3:E15 to F3:F15. I want to keep that going to the next and the next with the same macro. But it just keeps copying the the original range which I recorded in the macro, but I want it to keep going. If somebody can help me with that, I would sure appreciate hearing from you.
View 8 Replies
ADVERTISEMENT
May 26, 2014
I have a spread sheet where you fill in an order, so customer name, item being purchased, quantity and price. I now need a macro that will copy that info over into an invoice.
If the customer is only buying one item, that would be straight forward, as it could just copy that info across, but if the customer buys two items, the macro needs to see that there is more data to copy, then insert a new row on the invoice and copy the details of the other item.
View 2 Replies
View Related
Jun 9, 2006
I browsed through the other posts concerning copying and couldn't find (or maybe I didn't just understand) how to do what I want. I looking for a macro for a comand button that when pressed copies certain cells in the active row to another sheet. I recorded a macro for what I wanted to do ( to make the explenation easier) for one row but even the recorded macro refuses to work.
I'll put the recorded macro here if it helps someone, but as I said even that doen't work
Private Sub Kopiering_Click()
Range("E3").Select
Selection.Copy
Sheets("TOTAL").Select
Range("K3").Select
ActiveSheet.Paste
Sheets("BRL Newbuilding").Select
Range("D3").Select
Application.CutCopyMode = False
Selection.Copy
View 8 Replies
View Related
May 3, 2014
I've got a problem with copying cells from table A to B.
A short insight of the situation:
Table A shows: ITEM_1 = 3, consequently ITEM_1 from table A is copied to table B for 3 times.
I've got a few huge information blocks to handle (up to 5000 items) obviously it's unreasonable to do this manually.
I've added an xlsx file with more detailed description.
Example_WHS.xlsx
View 8 Replies
View Related
Sep 22, 2012
Why does my macro mess up on second line C23 and not places Play Equipment or the amount in the right column it stays on row C22
[URL]....
Code:
Private Sub CommandButton1_Click()
Dim SheetName As String
SheetName = "Estimate1"
SheetName = InputBox("enter the name of a sheet to use", "sheet name", SheetName)
[Code]....
View 2 Replies
View Related
Feb 20, 2013
I've attached a sample workbook in which there are 3 macro-buttons.
The buttons will paste a shape in the active cell. So this means the buttons themselves could be deleted and replaced with a shape.
Since locking and then protecting the cells disables the macros, how can I amend the code to make sure the buttons' cells are protected from the copying and pasting macros? Or, how do I ensure that the macros only work in A1 - E5?
View 4 Replies
View Related
Jun 25, 2009
I need to search column C for the text "X". If an "X" is found, I need to copy the text from the cell directly left of it and paste it into a seperate worksheet into cell B2, then go back to the original worksheet and delete the cell with "X" on it and the cell to the left.
View 9 Replies
View Related
Oct 30, 2012
I have a spreadsheet that allows users to paste set data from a PDF Image (using OCR) straight into Excel and then use the MID function to split the data accordingly.
Unfortunately, the OCR isn’t too intuitive and gets it wrong sometimes.
So to counter this, in another sheet (in the same workbook) I have a manual input section, and a simple macro button that pastes this data into the same fields where the OCR text would be, so that the main sheet works exactly the same way as before.
The problem is, and most likely due to the simplicity of the sheet, if a combination of OCR pasting and manual inputting is used, when I hit the paste button, it over rides the OCR data with blank cells
In the link below I have shown what is currently happening (1, 2, 3), and an example of what I would actually like it to do (4, 5, 6).
Example - Online Spreadsheets - EditGrid
So, in the 2nd scenario, I would like “5” to recognise that the respective cells in “4” already contain data and fill them ‘Grey’. This I have already achieved with basic conditional formatting.
However, I need to take it 1 step further and say that if the parent sheets cell (Auto OCR) contains data, as well as filling cells (in sheet Manual) lock these cells off and prevent the end user from adding data and/ or being copied over to the parent sheet.
Is this possible?
The result then being the parent sheet with both OCR text and copied text from the manual input sheet.
Both sheets are protected anyway and only allow for user input in certain areas, so is it even possible to apply further protection once the sheet is locked already?
View 1 Replies
View Related
Dec 12, 2007
I am trying to make the cells Iam am copying paste hidden cells with all formats - seems to work fine other than the security part of them, Iam makeing a sheet for work and just trying to make it were it will not get destroyed by other users-
View 12 Replies
View Related
May 29, 2014
I wish to copy a merged cell (3 cells) based on if only 1 of 3 cells to the right contain "X". if the top cell does not contain "X" than the merged cell is not copied. Also, is therea more elegant to copy 3 columns at a time rather than do one at a time as my code shows:
Sub CopyICUCAPU()
'
' CopyICUCAPU Macro
'
Dim i As Integer
[Code].....
View 14 Replies
View Related
Jul 25, 2007
i have a button and code so that when i click the button it prints, saves and creates a new worksheet ie job 2 ready for data entry,
somewhere in that process i would like it to copy the contents of certain cells from sheet job 1 to sheet job list,
View 10 Replies
View Related
Aug 12, 2008
I have a worksheet with columns as follows:
col A Name
col B Category
Col C Subcategory
In column A every row has a name, but in col b and c only the first row of a category or sub are popluated, for example:
Name CAT Sub
a 1 1
b
c 2 2
d 3
e
f 3 4
g
h
As I work with many of these spreadsheets, they are all different in respect to number of products(name) and number of CAT and SUBCAT.
View 12 Replies
View Related
Jun 18, 2008
I have a list of names in column a, and in column b either a "0" or a "1"
as part of a longer piece of code I need to be able to copy the names that have a "1" next to them over to column c
View 18 Replies
View Related
Jun 15, 2009
I need help with copying some data from one sheet to the other, but I am really bad at explaining this. Can I send the excel sheet to someone and then explain it? I think that will be easier, cuz Ive tried explaining it on another forum and nobody understood what i was saying without being able to see the sheet.
View 9 Replies
View Related
Aug 8, 2008
My issue is that i have a excel spreasheet that contains macros. These macros work on my computer and our VPs computer. We have 4 other computers that were bought recently that have all the same operation systems as mine and the VPs, and save version of excel. I can not figure out why it wont work. Following is the code. I think what i have it narrowed down to is the rRange.copy. I dont think its copying on the 4 computers that it dont work on.
' this section prompts the user to select a range
Sheets("2008 drivers sch").Select
Dim rRange As Range
On Error Resume Next
Application.DisplayAlerts = False
Set rRange = Application.InputBox(Prompt:= _
View 9 Replies
View Related
Oct 27, 2008
I'm using Excel 2003, Windows XP, and Microsoft Outlook. I'm trying to copy some cells, which include merged cells, from Excel into a new e-mail using Outlook (the output of some calculations), but every time I do this, Outlook seems to unmerge the cells.
When I paste into Word, the cells remain merged; I can then copy/paste from Word to Outlook with no unmerging occurring. what's going on and/or how to resolve this issue so I can copy things into Outlook straight from Excel?
View 3 Replies
View Related
Feb 16, 2009
I am copying a range of rows (which include some hidden rows). When I paste them I see all the rows. Is there a way to retain the hidden attribute?
View 2 Replies
View Related
Aug 20, 2014
I want to be able to have a range selected and copy the cells offset it it at (0,-2),(0, -4) and (0,-7) all at the same the to reduce the macro time.
View 1 Replies
View Related
Jan 29, 2014
I need to start from its most basic so i can see what the macro is doing & then adapt.
See attachment.
This will take the form of a button to be clicked on in sheet1.
Sheet1 is my input sheet, sheet2 is my history sheet.
I want to copy the cell range B4:F9 in sheet1 into sheet2 - starting from cell C3.
Next time i click the button, copy the cell range B4:F9 sheet1 into sheet2 again, but underneath the data already there in sheet2
Each time i click the button it just keeps adding the data in sheet1 into sheet2, to form a history.
View 6 Replies
View Related
Mar 19, 2007
I'm trying to copy cells from one sheet to another. I know that if I know what cells I want then I can use something like this:
View 9 Replies
View Related
Aug 9, 2007
I am creating a macro to copy data from one workbook that is emailed to me to another workbook that contains the actual macro, I will be using the second workbook to import the data into an application.
What I need is to be able to copy text in cells say D1, D3, D6 etc located in workbook1 to cells say A1, A2, A3 etc in workbook2 without having the macro go back and forth each time to copy the cells one at a time.
Also is there a macro that will recognize an already open workbook that I can use to copy the data
View 10 Replies
View Related
Feb 17, 2009
I just need to know how to reference another workbook in order to copy values from cells on it to my own version of it. It's 18 pages, and I need to pull certain columns cell values from certain sheets (these columns are all fixed, no fancy statements required). I'm unfamiliar with the structure required to refer to another workbook. All I need to do is say "This workbook-Sheet1!D2:D20 = Workbook"Feb"-Sheet1!D2:D20", and so on, throughout the sheets.
I did look for solutions to this, but all of the answers are mixed in with complex statements for other simultaneous calculations... I find myself unable to pick out the small piece which I need from the mash of code I'm unfamiliar with.
View 5 Replies
View Related
Mar 11, 2009
I would like to be able to copy a group of cells from sheet 1 to sheet 2 or 3 based on a value in another cell on sheet 1 eg
sheet 1
If Cell A1 = 24, A2=London Road (this make up an address), A5= omit
If A5 = omit I would like the address copied to sheet 2
If A5 = Complete I would like it copied to sheet 3
I have 1600 address to go through.
View 6 Replies
View Related
Mar 16, 2009
I have a spreadsheet like that attached where there are titles down Column A, and every second column from B on there are data entries I wish to copy to the other alternate columns. For example B1:B2 into C1:C2, D1:D2 into E1:E2. I have an example of how it is and how I wish it to be in my attached spreadsheet. This is my penultimate dilemma in the spreadsheet I've been working on for a few days, excited to nearly be there!
View 4 Replies
View Related
Jun 4, 2009
I am using a macro to copy a variable column of data from one file column A:4to another but what I want to do is copy the column apart from the last 2 cells. I am using:
View 2 Replies
View Related
Dec 7, 2009
i am trying to copy specific cells for mutiple worksheets and past them into a summary page. i can get that to work but not all the cells on all the sheets are populated and i cant get the blank cells to be pasted to the summary sheet so that each sheet has 31 entries.
View 6 Replies
View Related
Jan 26, 2010
1) The following code works well except for 1 wierd circumstance. This UDF code resides in a Cell in workbook 'A'. If I have another workbook open (call it workbook 'B'), and I do ANYTHING in workbook 'B' (like copy a cell to another cell within workbook 'B', or perform a calculation within workbook 'B', or even copy a cell from 'A' to 'B'), then the cell that this UDF resides in (workboook 'A') will change from a good number to a #VALUE error. If I work ONLY within 'A', then this UDF functions properly (giving a good result).
2) If I hit the F9 button (i.e. re-calc), with workbook 'A' active, then the #VALUE goes away, and the good number comes back. To clarify, all workbooks have AUTO CALC enabled. I guess the 'Application.Volatile' line causes this code to run when I hit the F9 button (thereby clearing the #VALUE error). If I hit F9 with 'B' active, then the #VALUE error (back in 'A') goes NOT clear.
3) NOTE #1: If I put a BREAKPOINT inside this code, and then repeat a "copy from cell to cell" within workbook 'B', I find that the following code DOES NOT execute, as it does NOT "stop" the code at the BREAKPOINT line. But, when I hit F9, then it DOES stop at the BREAKPOINT.
4) NOTE #2: If I "comment out" the Application.Volatile line, it still does the SAME thing. Except worse, then when I hit F9, it doesn't correct the #VALUE error. I really need the Application.Volatile step with this code, as these functions will not automatically update if their referenced cells are changed.
5) NOTE #3: The variables Row_Num & Column_Num are declared at the Module Level. If I use unique variables and declare these at the Procedure Level, it makes NO difference. I also tried putting a "DoEvents" line after Application.Volatile, but NO difference.
6) It seems I need this code to execute whenever there is a "change" on ANY workbook. Or else, do something to keep these cell values from changing anytime there is "action" on another workbook. Or, is there better code to do the samething? ... Do you have any CLUE how to fix this SNAG?
View 13 Replies
View Related
Jun 25, 2012
I've got a macro with copies certain data from 1 sheet to the next. The problem I have is that some times there is an autofillter on the data.
I think I need to add .SpecialCells(xlCellTypeVisible) in to the code some where but im not sure where.
my current code is as follows. This is only a part of the code. It also copies other columns across to the other sheet
Code:
Sub CopyPasteMacro()
'
With Sheets("Imprint Data")
LastRow = .Range("A" & .Rows.Count).End(xlUp).Row
Set rngToCopy = .Range(.Range("B6:B" & LastRow), .Range("B6:B" & LastRow))
End With
rngToCopy.Copy
Sheets("To Key @ TE Imprint").Range("D4").PasteSpecial Paste:=xlPasteValues
End Sub
View 1 Replies
View Related
Jul 29, 2014
i am trying to copy few cells with data, and i have something like this:
Range("A3:AO" & Format(intRowCounter, "###")).Select
So this will copy all data withing those cells range, however, i want to copy only data from specific columns, ie, from column A3, and from K3:J
View 1 Replies
View Related
Feb 14, 2007
I am trying to do a loop to go through all the sheets in a workbook (11 ina all) that will copy all the cells and paste special value. below is the code i am trying to use and it is giving an error.
For Each sheet In ActiveWorkbook.Sheets
Cells.Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Next sheet
View 9 Replies
View Related