"smart" Copy Paste

Dec 8, 2008

i need a VBA string that will be able to copy and paste values but can self adjust, let me rephrase that:

i get some raw data from another application and need to paste it on to excel and lets say that that data fills up cells A1 trough H200

HOWEVER this data ALWAYS varies in row length like it could be A1 trough H500 and so on,

when i try to record a macro to do this it will by default go and paste tha new data where the original macro was recorded say a1 trough h200, but i need the macro to acknowledge the fact that that row is not empty and should paste the data on the next available row,

in the end what i need is for this data that varies in length to copy and paste its self right below it to obtain the same data 10 times,

say row a1 has "Jack" and row a2 has "stacy" i should have Jack and stacy 10 times down

Jack
Stacy
Jack
Stacy
Jack
Stacy
Jack

etc...

View 9 Replies


ADVERTISEMENT

Copy, Paste, Change Font Size, Copy, Paste, Print VBA

Mar 29, 2009

I'm using 2003.

1. Copy cells B5 to V-First blank row in Strength Tests worksheet
2. Paste cells into Racks worksheet in cell C5
3. Change font size to 6
4. Sort by Column T descending then by Column C ascending
5. Copy one row (A5-W5 (1Rx23C)) from Racks worksheet
6. Paste row into M1 worksheet in cell D4
7. Print M1
8. Drop down one row on the Racks worksheet
9. Repeat steps 5-8 until there's a blank row.

View 9 Replies View Related

Merge Data (smart) From One Sheet To Another?

Mar 18, 2014

So I have two worksheets. One sheet has all of the names of attendees to a current event (column a, about 109 entries), and the other sheet has all of the names that have ever registered for my events along with their emails (column a and column b, 3000 entries). I need to merge data from column B of the second sheet to the corresponding name in the first worksheet, and disregard the extras (or just put them at the end so i can clear the contents). So I am just trying to get the email addresses of the people in the first sheet, from the data in the second sheet.

I've tried to look at the consolidate data function, but that does not match up the names to the email addresses correctly. What about a filter?

View 2 Replies View Related

Creating Smart Dropdown List

Apr 6, 2011

I have a drop down list in excel. What do I need to do so that it will automatically take me to the closest/best label on the list when I type just a few first letters?

View 14 Replies View Related

Smart Range Selection In Macro

May 22, 2013

Im having some problems with range selection in macros. Basically, what the macro does is Copy / Paste as Values in differet sectors of an active worksheet, so this is the code for each range of cells that I need to copy paste:

Code:

ActiveSheet.Range("C14:E15").Select
Selection.Copy
ActiveSheet.Range("C14").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False

The problem with this code, is that because it specifies EXACTLY which range to select, if I add a row before that range the macro will be now selecting an incorrect range.

For example, say I have a value on cell A5, and the macro is set up to copy/paste that cell. Later on, I decide to add a row in A3, so the value I would need to copy/paste will now be in A6, but the macro will still execute on A5 (incorrect, as it should now execute in A6, and that is what I have to manually correct each time).

View 3 Replies View Related

Smart Generation Of Coordinates For Excel Shapes VBA

Sep 5, 2013

I'm using Excel to create a flowchart from a configuration sheet. I'm not manually entering the coordinates. Instead, I draw the start step in a set location. The next step(s) that's connected to the first step is placed directly below the start step. if there's more than one step connected to the start step, it's placed at the same y-coordinate but shifted along the x-axis.

The problem I'm running into here is this: say I have three steps connected to the start step and three further steps connected to the first of the three connected to the start step, how can I keep track of this and shift the other two steps connected to the start step along the x-axis so they're not positioned above the four steps below the first step (and as such, in the same location as other steps)? I'm not sure if my description is particularly clear or not so I've attached a drawing that will hopefully clear things up.

Is there any way of giving Excel shapes a "weight" so that other shapes won't line up on top of them?

View 3 Replies View Related

Event OnClick - Show Smart Art Shapes Below (child)

Oct 10, 2012

I'm trying to make a menu in my Workbook to access all the others sheets.

To make things easier for my boss, I'm trying to make the menu with SmartArt Shapes (Hierarchic) because it's easier to add/remove itens.

The thing is: he wants it to show the boxes below (hierarchic child) when i click the "mother" box.

It will work pretty like web menus except the mouseover. Image below

menu.jpg

View 1 Replies View Related

Finding Smart Coding Userform Textbox Values To Sheet

Mar 21, 2012

In my userform I have a lot of textboxes. When the user clicks "OK" the values of these textboxes are transfered to row 3 of sheet1.

For this I use some of the code below:

Code:
If NaamTextBox.Value = "" Then ActiveCell.FormulaR1C1 = " " Else: ActiveCell.FormulaR1C1 = NaamTextBox.Value
ActiveCell.Offset(0, 2).Range("A1").Select
If GroepComboBox.Value = "" Then ActiveCell.FormulaR1C1 = "" Else: ActiveCell.FormulaR1C1 = GroepComboBox.Value
ActiveCell.Offset(0, 1).Range("A1").Select
If TypeTextBox.Value = "" Then ActiveCell.FormulaR1C1 = " " Else: ActiveCell.FormulaR1C1 = TypeTextBox.Value
ActiveCell.Offset(0, 3).Range("A1").Select
If TypecodeTextBox.Value = "" Then ActiveCell.FormulaR1C1 = " " Else: ActiveCell.FormulaR1C1 = TypecodeTextBox.Value

This goes on for about 55 columns. Also, not every column is used as you can see in de code above.

It seems to me that this is not smart coding, so my question is: can you make this more efficient?

I did find some nice code with uses EmptyRow (find first empty row) but in my case it's always row 3 where de input is placed. After this row follows much more data.

View 5 Replies View Related

Smart Filter To Only Show Contract Items That Had Major Impact On Gross Profit

Mar 10, 2014

seeattached data set.

Contract Item
Gross Profit
GP %

[Code]....

It is Gross Profit in Dollars and % for a particular project. Each row is a contract Item. The Overall Gross Profit for the month in dollars is 34,114.86 In preparing a short commentary to discuss this 34,114.86 I need to discuss atleast some contract items. If there were no negative results I have often in the past simply written. The top 5contributors to this Gross Profit were contract items 1 -6, out of 42, delivering 80% of the result. I might also go into what actually those contract items were and why they presented such a decent Gross Margin, ie. Costs came in well under budget(estimate). But with negative results, the bottom 4 contract items represent a large dollar loss of-34k which is 100% basically of the Gross Profit itself. If these had even just broken even we would have a GP double the current amount. So they obviously deserve as much comment.

Q1
In excel orsimilarly in say Crystal Reports what is a good way of further sorting these 42records either in a table or chart, whereby say the top 80% contract items that had a major impact on the gross profit are shown and the rest hidden. Ie. All thelittle sub 1000 or sub -1000 amounts.

Q2
How wouldother people here write a commentary on this data set? Can you script something to illustrate?

View 3 Replies View Related

Copy / Paste Certain Cells Then Paste 3 Sheets Into New Workbook - VBA 1044 Error?

Feb 3, 2012

This macro works fine on my machine but not with other users:

This should copy/paste certain cells then paste 3 sheets into a new work book.

ON other computers it seems to paste in a picture? works OK for me?

Sub ValidationTests()
'
' ValidationTests Macro
' Macro recorded 21/12/2011 by '
'
Sheets("Score Sheet").Select
Range("A8:M18").Select
Range("H18").Activate
Selection.Copy

[Code] ..........

View 1 Replies View Related

Excel Macro To Copy Data From Array And Paste To Separate Sheet Paste Special Transpose

Jan 29, 2014

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?

View 1 Replies View Related

Simple Copy Sheet Paste In Other Book But Paste Values?

Jun 20, 2013

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")

[Code].....

View 9 Replies View Related

Copy / Paste Every Sheet Single (P Column) And Paste To Notepad

Sep 6, 2012

copy/paste Every Sheet Single ( P Column ) and Paste to Notepad and take P1 As file name for note pad.

View 1 Replies View Related

Create Macro That Can Copy / Paste Or Cut / Paste Rows Into Different Spreadsheet

Oct 1, 2012

I have one workbook that needs two macros.

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.

View 2 Replies View Related

Copy And Paste Without Disturbing Existing Data In Paste Area

Nov 25, 2012

HTML Code:

Range Apple
A B C D E
1 2 2 4 3
2 1 3 5
3 4 6 9
4 5 3 1 3
5 7 7 7 6

Range Pear
A B C D E
4 1 3 5
5 1 1 1
6 2
7 2 2
8 5 7

Range Apple
A B C D E
1 2 2 4 3
2 1 3 5
3 4 6 9
4 5 3 1 3
5 7 7 7 6

View 2 Replies View Related

Prevent Copy / Paste Cells With Comments Or Allow Paste But Do Not Paste Comments

Feb 4, 2014

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".

View 7 Replies View Related

Copy And Paste From One Sheet To Another Based On Column A Using A Macro Copy Button

Jan 22, 2007

I want to copy and paste from one sheet to another based on column a using a macro copy button.

E.g. if column a value = apple then copy that row into the apple sheet.

View 9 Replies View Related

Copy & Paste Macro Won't Paste

Jul 10, 2006

I want this macro to find in this case "406" in column A which is at the very end of the last block of 160 rows of information.

I then want it to move up 159 rows and copy 160 rows of information underneath the last block of information.

i.e.go to A5280 , then go to a5121, copy rows 5121:5280 to 5281.

It falls over on the very last line of code I can see A5281 selected but it won't paste....

View 9 Replies View Related

Copy/paste Macros Will Not Copy Filtered Items

Sep 25, 2009

The following sub will look in the file ("FY09 SOF"), in column "A", search for the strings that begin with "2109", "3009", or ends in "-1", and copy the entire row. It will then paste these in the file ("FY09 PR Log Blank").

I have found that in the file ("FY09 SOF"), if things are filtered in any row, it will not copy those necessary items.

The data filter is on row 13 of each sheet. Is there a way of fixing this? (i.e. having the macros select "all" on the filter before copying the sheet? There are 60 sheets so a macros will be necessary.

Sub get_data()
Dim wb As Workbook, wbDest As Workbook
Dim ws As Worksheet, wsDest As Worksheet
Dim lngCalc As Long
Dim FoundCells As Range
Dim FoundCell As Range

Set wb = Workbooks("FY09 SOF")
Set wbDest = Workbooks("FY09 PR Log Blank")
Set wsDest = wbDest.Worksheets("Paste all here, then sort")

With Application
.ScreenUpdating = False
lngCalc = .Calculation
.Calculation = xlCalculationManual
End With
For Each ws In wb.Worksheets.............................

View 9 Replies View Related

Replace Copy VBA With Copy Paste Special Value

Jan 1, 2013

I've received an Excel file with the below macro. However, I've made changes in the original file and therefore, the macro isn't working anymore except if I copy paste special the value instead of simply copying it. I would need to change the macro accordingly.

The macro is the following :

Sub CCtosheetwithoutformat()
'
' CCtosheetwithoutformat Macro

[Code]....

View 2 Replies View Related

Copy Formats Without Copy/Paste

Jul 23, 2009

I currently have a macro that outputs data to a bulletin-board type table in my worksheet. At the moment, what happens is that the macro copies the entire table down one row using copy/paste, then prints a new line of data to the top row of the table.

This works great because it is very fast and because I only have to format each line once--the formats just get copied down every time a new line of data is added.

My problem is that while this program is running, I am unable to use copy and paste in windows, because the copy/pasting from the macro overwrites the windows clipboard.

Is there a way for me to "copy" formats from 1 range to another range of equal size without actually using copy/paste? I know this can be done with values (eg. range("B2:B4").value = range("A2:A4").value), but I can't get it to work with any sort of formatting.

View 9 Replies View Related

Copy/paste Values (copy Values Of Cells From B4 Till B-empty To C Column)

Jun 26, 2009

Sheet linked from external file, new data coming daily. How to copy Values of cells from B4 till B-empty to C column? The attached file has a properly displayed data.

View 3 Replies View Related

Copy Method (copy From The Selected Cell And Paste One Cell Below(next Row) In Same Column)

Oct 23, 2009

what is wrong in this code, it does not paste.

HTML Range("A65536").End(xlUp).Offset(0, 0).Select
ActiveCell.Offset(-1, 7).Select
ActiveCell.Copy Destination:=ActiveCell.FormulaR1C1 = "=(R[1])"

I am trying to copy from the selected cell and paste one cell below(next row) in same column.

View 2 Replies View Related

Copy From Template And Select Any Sheet That Starts With S And Copy / Paste This Template To

Aug 19, 2008

I have a list of invoice #'s on a sheet named "Temp Sheet".

I have a VBA macro that created a new tab for each entry and named it the invoice #. So basically the vba code created a new tab ( based on the number of invoice #'s on my list ), and named each tab an invoice number. So if I had a list of 10 invoice #'s, named S1-S10, the vba code created 10 tabs, named S-1, S-2,. S-3.....

Now to my question.
I have a template sheet I want to copy from ( "Template" ), and select any sheet that starts with "S", and copy/paste this template to.

View 9 Replies View Related

Copy / Paste To Last Available Row

May 31, 2014

I need a macro code that when the button1 is pressed, it will ask for a range or it will capture a range, when the range is identified, the range value will be copied and pasted to the next available line/row when I click button2.

In this sample I select the range columnA and columnB

Column1
Column2

row1
Apple
Ball


[Code] .......

When I press the button2 to copy/paste the table should be:

Column1
Column2

row1
Apple
Ball

[Code] .......

It is like Duplicating a selected range.

View 1 Replies View Related

Copy And Paste Under The Last Used Row?

Mar 24, 2014

I have a macro recording some production data. Everything works fine except the last action. I want to copy all data from active sheet (row 31 until last row in column M), then open another sheet (database) and paste data under the last row. Everything works, but the data always paste under the last cell in column "A" and rewrite data in other columns under this row (cells in column "A" are not always having data in them). That makes sense, because I'm using the "A1000000" as Range in my code. But I have tried everything to make it work, based on the last cell/row used with no success. Ideally, I would like to find the last used row within columns A:M and paste the data underneath. Some of the columns have date or name (not sure if that makes any difference). The copy and opening+closing works fine,

Here is the code:
Application.ScreenUpdating = False
Application.CopyObjectsWithCells = False

Dim Rowcount As Integer
Dim DataRowCount As Integer

[code]....

View 3 Replies View Related

If Then Copy Else Paste

Nov 28, 2013

I'm trying to get a loop to copy a cell(B?) value if a cell(F?) is blank, and then paste that copied value(from B?) into a different cell(A?+) if it is not.

I know the first run of the loop will always result in the copy happening. However, when it comes to the else paste it fails.

Code:
Range("A:A").Insert Shift:=xlToRight
Rows("1:10").Delete Shift:=xlUp
Range("A1").Select
Do While IsEmpty(ActiveCell.Offset(0, 1)) = False
If ActiveCell.Offset(0, 5).Value = "" Then
ActiveCell.Offset(0, 1).Copy
ActiveCell.Offset(1, 0).Select
Else
ActiveSheets.Paste
ActiveCell.Offset(1, 0).Select
End If
Loop

View 1 Replies View Related

Copy And Paste With VBA?

Aug 15, 2007

I am not too sure if what I want to do possible with VBA.

In cell B14 I want to copy the data starting from cell B43 and downward. That is to say if cell B43, B44 contain data and if B45 is blank only B43 and B44 will be copied into cell B14 sequentially. It is like entering data in cell B14 and then press Alt Enter to allow entering data on another row for data from B44.

It will be wonderful if this can be done as I have more than 100 worksheets to go through for this repetitive action.

View 9 Replies View Related

IF A = B Then Copy C & Paste It In D

Dec 19, 2008

I have a workbook with 2 sheets.
in "sheet 1" I have "column A" with "part nos" and "Column B" with OLD "prices"
in "sheet 2" I have "column A" with "part nos" and "Column B" with NEW "prices"

I want a macro that would do the following:
for each cell in "column A" of "sheet 1" the macro will check "column A" of "sheet 2", if the values are equal, it should copy the value of the corresponding cell in "column B" to "column B" of "sheet 1"

I have a list of items (3000) with prices and I received a new list (14000) with newer prices. the problem is I need the prices only for the items in my initial list.

View 9 Replies View Related

Copy Paste

Jul 27, 2006

Im having problems copy and pasting. I've got the following code

Private Sub CmdImport_Click()
Dim ImportName
'Dim CurrentPO
'On Error Resume Next

'CommonDialog.Filter = "Excel Files|*.xls;"
CommonDialogImport.DialogTitle = "Please Select the file to import"
CommonDialogImport.InitDir = ("\CcnofficeshareddocsNORGlazeNORGLAZE.BUYINGNORGLAZE.Purchase Orders") 'CURRENTMONTHTEST")
'CommonDialog.InitDir = ("e:VBA PO FormCURRENTMONTHTEST")

CommonDialogImport.ShowOpen......................................

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved