Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Excel


Copy/Paste Not Copying Cell Formatting (row Height)

I am having a problem with a excel spreadsheet. There are no formulas or anything, just text that I used excel to get everything lined up. I haven't had any issues before, I was copying and pasting within a document. It was all text with different row heights set. I ran into a problem now where the text copies and pastes fine but the row heights aren't coping into the cells I am pasting into, just the text. What do I have to do so they will copy? I don't want to have to go an individually adjust each cell.

View Complete Thread with Replies

Sponsored Links:

Related Forum Messages:
Copy Method (copy From The Selected Cell And Paste One Cell Below(next Row) In Same Column)
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 Replies!   View Related
Display The Row Height In A Cell
Can I display the row height in a cell

View Replies!   View Related
AutoFit Row Height On A Merged Cell
I'm using Office 2007 professional and I'm trying to format a cell (merged cell) so that when you enter text and it goes beyond the size of the designed cell that it will automatically continue and shift the additional text downward, like a paragraph. Also it shift everything below down with it. Is this possible? I have already tried wrap text field and AutoFit row height. This keeps it within the cell but it is not visible or printable once you tab out. I would like to have it continue like in a paragraph. Like a word doc may do. Itís visible and it shifts everything below downward as it grows, which also allows it to be printable.

View Replies!   View Related
Copy One Cell And Paste Into Next Available Row On Sheet2
I have a live stock quote that refreshs every second (for reference, Sheet1A4), I would like to paste value A4 into next available row on sheet2 of the same workbook.

If possible, I would like to be able to copy several cells on Sheet1 and paste them in various sheets within the same workbook. Can you help me out or point me in the right direction to a previous thread.

View Replies!   View Related
Copy And Paste Row By Cell Value Criteria
I am trying to copy and paste Row by cell value. It is working fine when I am copying row from one worksheet by comboBox value to other worksheet. But problem is after updating data when I want copy back by cell value, it is showing "Run-time error '1004'" - Application-defined or Object-defined error. the code below is working fine

Private Sub CommandButton1_Click()
Dim sfind As String
Dim cl As Range
'check for a value & show message
Sheet = "Data"
Application. ScreenUpdating = False
If Me.userIDCombo.Value = "" Then 'the textbox in userform
MsgBox "Please enter a Name to Update."
' show message if no Name Selected
Exit Sub
sfind = Me.userIDCombo.Value.........................

View Replies!   View Related
Copy And Paste Row Of Data Where Cell Contains Criteria
I need to be able to search column y and rows 5-100 and where cells contain "A" copy and paste entire row to row 110. I am guessing it is really simple but I am obviuosly missing something

View Replies!   View Related
Copy And Paste A Row When A Cell Is Filled With The Color Red
I would like the users to have the option of filling in the cells with "RED" by any means.

Here are the conditions or pseudo
If (any cell in Column X is RED)
Then (copy the row to Copy Rows Filled With Red)

If ( the cell in Column X is not longer RED)
Then (remove the row from Copy Rows Filled With Red)

In plain English, if the cell is filled with RED, it is copied over to sheet Copy Rows Filled With Red. Or if the cell is no longer filled with RED, it is removed from Copy Rows Filled With Red.

Please see attachment for explanation.

View Replies!   View Related
Copy And Paste A Row When A Cell Is Filled With The Color Red ..
I am trying to create an conditional statement using this code

View Replies!   View Related
Find Specific Cell, Copy Row And Paste Into New Sheet
I have a excel file with two worksheets. I need to find a specific row in column g, cut the entire row, and paste it into sheet2. I have started off by using this code, that I got off of some site. It works wonderfully in finding the specific cell, but just copys and moves the specific cell into sheet2. Whereas I need it to cut and paste the entire row where it finds the cell that begins with a 3 in column G.

Sub Copy_To_Another_Sheet_1()
Dim FirstAddress As String
Dim myArr As Variant
Dim Rng As Range
Dim Rcount As Long
Dim i As Long

View Replies!   View Related
Spinner Link Cell Doesnt Change When I Copy And Paste The Row
I have a Piece of Code that copys a Row in my Spreadsheet and Pastes it underneath the original Row.

The Problem that I am having is that within the Row it Copys there is a Spinner in it. I want the Spinner to be copied also but the Cell that the Spinner is Linked to Says as the Original Cell, it doesnt move Down with the New Row Pasted in.

Here is the code that i have written to Copy the Row and Paste it down a Row.

View Replies!   View Related
Copy The Information From The Row Directly Above The New Row And Paste (values, Formulas, Formats, Etc) Into The New Row
1. In whatever cell is selected when the macro is run, enter a new row.

2. Copy the information from the row directly above the new row and paste (values, formulas, formats, etc) into the new row.

3. Return to column P in the new row, i.e if the new row is row 11, then return to P11, for row 12 return to P12, etc.

I have tried recording the macro but because it is hard coded to specific rows, its not working. I have attached a sample copy of the sheet (had to zip due to the size of the file).

View Replies!   View Related
Conditional Formatting Copy And Paste
i have an equation in A1, and i use conditional formatting for this cell, if the value of C1 is less than 1000, the result in A1 is red

i want to copy the result and the color of A1 to D1, i use paste value, the value and the color are then copied to D1 at first. but when i modify C1, the color of D1 also changed.

View Replies!   View Related
Copy And Paste Conditional Formatting
I am trying to figure out how to copy and paste conditional formatting.

1371908# on hand 16458
ACNF18051 208
ACNF18061 104
ACNF30081 208
1371908 Total416104

1371911# on hand 7053
ACNF18051 208
ACNF18061 104
ACNF30081 208
1371911 Total416104

for instance in the above.. I want to black out any number in the "total" (bold) row that is less than the On Hand Qty (bold and underlined number) and I want to use a running total. For instance for part 1371911 with an On Hand Qty of 7053, the on hand is larger than the the first total of 416 so 416 should be blacked out, it is also larger than 416+104 so 104 should be blacked out as well.

This will continue until the on hand qty is less than the running total. I can conditionally format this one at a time and it could take forever as there are 3000+ lines of spreadsheet. If there is any way that you can tell me how to set the condtional format for one row and then cpy and paste it thoughout the sheet where needed.

View Replies!   View Related
Date Formatting Copy/paste
I have a spreadsheet of donations and the dates on which they were made. I input the dates like so: 1/2/2009, and then I format the cells so they appear like this: January 2, 2009. When I use this date in for MS Word "mail merge" functions, the date shows up in its unformatted formula bar form: 1/2/2009. I would prefer that it show up like January 2, 2009.

My question is this: is there any way I can change the cell formula bar to read like the formatted version rather than the non-formatted version? I want the formula bar to read "January 2, 2009" instead of "1/2/2009". Obviously I could type each date manually into the formula bar, but I'm looking for a quick copy/paste solution since there are hundreds of cells. I've messed around with "paste special" options to no avail.

View Replies!   View Related
Copy Paste Range Without Wiping Conditional Formatting
I need to apply conditional formats a certain range e.g. I8:I1000. Every time my spreadsheet is loaded with new data, the previous cf are erased, and I have to start all over again.

View Replies!   View Related
Finding The Column With The MAX Height In Comparson Wth Othr Columns Of UNEVEN Height
Finding the Column with the MAX Height in comparison with other Columns of UNEVEN Height

I need two things :

1. I have several columns starting from Column B till Column F, each column having values starting from the third ROW.


Lets say Column B contains two values in B3 and B4, Col C three values in C3 C4 and C5, Col D four values D3,D4,D5 and D6, Col E two values in E3 and E4, Column F five values F3,F4,F5,F6 and F7.

So, the answer is F3:F7.

2.I am using 10^{4,3,2,1,0} in a particular portion of a formula, Now the number of elements in the array or in the Curly Braces depends on the number of Columns filled from Column B as explained in the Point 1.

Now, since I have five columns under consideration I have this order as mentioned here {4,3,2,1,0} , I would like to know whether I could make this dynamic, as in if there were only four columns then this would be {3,2,1,0} and if more this array could self-fill and expand..

If that's possible, then how do we use it in the formula, Is it by the virtue of the INDIRECT function?

View Replies!   View Related
Macro For Copy/paste Selection Of A Row To A New Row On New Sheet
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.

View Replies!   View Related
Automate The Copying Of Formulas And Cell Formatting
is it possible, after inserting new sheet rows, to automate the copying of formulas and cell formatting into the newly created space, instead of manually copying the formulas and formatting down into each column?

View Replies!   View Related
Copy A Row And Then Paste It On First Empty Row In Another Sheet
Have a small VBA code that simply copy a row and then paste it on first empty row in another sheet. Its working if i use a regular macro, but i have some problems to get it to work with some code. I want it as VBA since the copying is alot smoother. The problem i have in the code is the PasteSpecial.value, Since i dont want the formula to get pasted. Attachiing the worksheet. Its the macro PasteSpecial that i need alittle guiding on if possible.

View Replies!   View Related
Copy Entire Row & Paste To Another Row
If I want to just copy row 3 to row 4, why does the following copy the data fine, but not paste and give error "Object does not support this property or method"?


View Replies!   View Related
Row Height
I am using excel 2003. I have copied and pasted text from microsoft word onto excel.

The text is already split up into rows and columns in word. When i past it into excel and select all thousand or so rows and then double click the row to engage the automatic row height it doesnt work. It cuts off the last line or last two lines of the text in most but not all of the cells. What can I do other than one by one change the row height?

View Replies!   View Related
Autosize Row Height
I have a spreadsheet in which double clicking on any of the cells in the range A4:C17 changes the contents of cells F4:I33. The following code tells me which is the active cell and then pulls the values for F4:I33 from a lookup table based in this.

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
Range("B100") = ActiveCell.Address()
Cancel = True
End Sub

code to stick in this (probably after the third line) that autosizes rows 4 to 33. There are no merged cells involved.

View Replies!   View Related
Locking Conditional Formatting In 2000: Copy/paste Text From Other Cells Or Columns Even Other Workbooks
I have a column "g" with this conditional formatting:- =A2<>A3 Format Bottom Border.
However I will pass this workbook onto someone else who will fill in the text in column "g". They will use copy/paste text from other cells or columns even other workbooks that will not have the conditional formatting.

I have used Cells > Projection > Locked unchecked then used Tools > Protection > Protect Sheet and checked all. There does not seem to be a way to unlock the cell but protect Conditional formatting. Each time I copy and paste from other non formatted cells it wipes out my formatting.

View Replies!   View Related
Formula To Calculate Row HEIGHT
I need a formula to calculate the height of a cell. Basically I will repeat this formula thoughtout the database, and each cell in column U will have its row height.

have come up with the following

Function RangeHeight(rng As Range) As Double
RangeHeight = rng.Height
End Function

Now, the problem is, that the formula does not automatically update when the row height changes, and when I open the file on another pc, all the formulas change to #NAME since it does not recognise the custom formula.

View Replies!   View Related
Automatically Adjust Row Height
I have a vlookup into a row of cells. Sometimes the new text is so long it has to word wrap. How can I get the ros to expand with out me manually doing each row, and then go back to one line with the data changes.

View Replies!   View Related
Row Height Specifically For Page Breaks
I have a spreadsheet that I use for work that I have set the row height specifically for page breaks. I use the top 3 rows on each page as a header with that page info.

If I update it at home, then email it to work, the row height has changed. No real problem, I just go in and adjust the row height. Then if I email it back to home from work, it does the same thing.

It's just this particular sheet that does it. All of the other sheets that I use always keep their row height properties intact when emailing.

View Replies!   View Related
VBA Can Keep Track Of Total Row Height?
I was wondering if VBA or Excel has the capability to add and total Row Height or Pixels? For example I have my Rows set to a height of 14.25 (19 pixels). My Range that I am working with is A2:T41 for a TOTAL ACCUMULATED ROW HEIGHT of 570 (40 Rows X 14.25) and 760 Pixels (40 X 19).

What I would like to accomplish is that once the TOTAL ACCUMULATED ROW HEIGHT of my Range reaches 570 then Row 1 appears. If the TOTAL is less then 570 then Row 1 remains Hidden.

Does anyone know IF and HOW this can be done? I need this due to the fact that the Rows will Autosize and I need to have my header Row appear. I can't just Freeze Row 1 because my actual Headers are on Row 16.

Hope this makes sense and hope that someone has a solution.

Bye 4 Now,

View Replies!   View Related
VBA To Autofit Row Height With A Minimum
I have a range named "rngOrders" on an Excel 2003 worksheet. I'm looking for a VBA macro that will set the row heights of the range to autofit (for rows/cells with wrapped text) and also set a minimum row height of 19.5 points for all rows.

View Replies!   View Related
Freeze Column And Row Height And Width
I need to freeze the column and row height and width for a specific area in spreadsheet, so that it shouldnt be altered in future from any one using this sheet.

View Replies!   View Related
Setting Row Height To Font Cause Hidden Rows
I generated my spreadsheet in using vb6.
Everything is working except that when I display the display (making it visible), some of the data in the rows hides underneath the row lines. I have to physically go into the spreadsheet to expand the rows to see the hidden data. Also, if I print the spreadsheet, the hidden part of the spreadsheet is cut off unless I mannually expand the rows. How can I programmatically expand the rows to fit each amount of records in the row. Currently, I have a module that is mannually calculating the rows

Also, I have attached the spreadsheet so that you can see my output.

Below is the code that calculates and formats the row presently:

w = 0
For Each R In xlWksht. Range("A5:N5"): w = w + R.ColumnWidth: Next

rht = xlWksht.Range("A5").RowHeight

With xlWksht.Range(xlWksht.Cells(ii + 1, 2), xlWksht.Cells(ii + 1, 14))
.HorizontalAlignment = xlLeft
.VerticalAlignment = xlTop
.WrapText = True
.Orientation = 0
.MergeCells = True
.RowHeight = .Font.Size * (Len(xlWksht.Range("A" & ii + 2).text) - Len("Comments:")) / w + rht + (rht - .Font.Size) ' + newlinecnt * .Font.Size
End With

Below is my entire module:

ii = 5
w = 0
For Each R In xlWksht.Range("A5:N5"): w = w + R.ColumnWidth: Next

rht = xlWksht.Range("A5").RowHeight

'Do Until M.qBW.EOF = True
Do While Not M.qBW.EOF
ii = ii + 2
xlWksht.Cells(ii, 1).Value = M.qBW![Req No]
xlWksht.Cells(ii, 2).Value = M.qBW![Description]
xlWksht.Cells(ii, 3).Value = ""
xlWksht.Cells(ii, 4).Value = M.qBW![ClientName] & Chr(10) & M.qBW![Status]
xlWksht.Cells(ii, 5).Value = M.qBW![P L] & Chr(10) & M.qBW![TotalProg1Hrs] ...

View Replies!   View Related
Macro Copy And Paste 2 In A Row
i am trying to record a macro that copies and pastes data from a webpage into a sheet in excel and then copies and pastes different data from a different webpage into another sheet in excel.

when i replay the macro it just pastes the same data twice instead of 2 different sets.

i am obviously making a basic error - is the way i copy and paste?

View Replies!   View Related
Copy Row And Paste To New Sheet
In case column C starting from row 3 to end, if any cell contain number ie numeric value then copy the entire row to a new sheet named "stmt" starting from row 2 ie start pasting from row 2 of "stmt" sheet.

View Replies!   View Related
Copy & Paste To Next Available Row
Thats the code of the button which I made (the file is atached),

Private Sub CommandButton1_Click()
Dim wb As Workbook
ChDrive "C"
ChDir "C:Documents and SettingsszmMy Documentszadanie bojowe"
FName = Application. GetOpenFilename("*,*.xls", , "Please select file to open")
If FName = False Then Exit Sub
For Each wb In Application.Workbooks
If wb.Path & "" & wb. Name = FName Then
MsgBox "File " & wb.Name & " is already open"
Exit For
End If
If wb Is Nothing Then....................

and question:
I want to add a formula to this one, to import data to the next row (skip previous) if the row where the data should be imported is not empty. I can make another and another button to do that (more than 300 ?) but I think its stupid. U can see how it look like in the file which is attached.

View Replies!   View Related
Vba To Copy And Paste Into Last Available Row
I have created a macros to copy cells on worksheet 'Workings' and paste these onto another worksheet 'CAP'. What I need is to edit this so instead of pasting the information into cells specific cells I would like to paste these into the next available row with no data in.

Sub Cap()
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
End Sub

View Replies!   View Related
Sheet Protection Conflicts With Code To Autosize Row Height
When turning on sheet protection, I get an error with the following code that I'm using to make sure rows adjust their height when lines wrap.


What can be done to eliminate this conflict? All of the cells I want available for editing are unlocked.

View Replies!   View Related
Copy Paste In 1st Empty Row
i have to copy a Range A2:AA2

and i want to paste it into the first empty row (A3, .....)

can anyone write me the code for that?

View Replies!   View Related
Copy And Paste Entire Row In Worksheet
I want to run a macro that looks thru column F of all my worksheets (in my entire workbook).

If it finds an x then I want it to copy that entire row and paste it into a worksheet called "old" or a new worksheet or a new document in word (it doesn't matter - just whatever is easiest for my little brain to understand).

I should end up with about 40 rows of data in the new sheet.
(I have some code that looks thru it all and colors the cell blue but I just don't know how to get it to copy and paste the entire row into a new worksheet.)

View Replies!   View Related
Copy And Paste Data Into Next Blank Row
I have been tinkering with a code for a few days now and managed to finally get it working . The Code basically copies data from one spreadsheet (Macro Tester6), opens up another spreadsheet (Macro Tester Master), pastes the data, Saves the file (Macro Tester Master) and then closes it.

The Macro Tester6 file is then left open as I prefer.

The problem I have is that the data always paste into the same row, hence overwrites data already inserted.

the code finds the next blank row to paste the data in.

My code is:

Private Sub CommandButton1_Click()
' select current workbook and paste the values starting at A1
Windows("Macro Tester6.xls").Activate
' open the source workbook and select the source sheet

View Replies!   View Related
Copy Formula And Paste Same Row To Last Column Used
I m finding the last used column and pasting a formula in the same row to the last column. Here is what I have used and it isn't working.:

View Replies!   View Related
Copy Range :: Cut/paste In The Next Available Row
I need some code that will copy cells A20:D20 then cut and paste in then paste in the next available row below (some rows below may be taken)

View Replies!   View Related
Speed Up Macro That Adjusts Row Height & Column Width
This used to (and on some machines still does) work very well, but all of the sudden on my work machine, it is incredably SLOW!! The whole program takes a list of tasks and dates, and creates a wall calendar from them. Then (the offending part, below in code) looks at each cell on the wall calendar and formats it by sizing the height of a merged cell so that the entire task is displayed, then goes on to put a square around it (works fine).

The formating of the cell height/width can take up to 11 SECONDS each cell. What is happening to do this? Again, it USED to, and on some machines still does, FLY through this process. But now it just crawls. Code below, with the 3 offending lines identified.

Private Sub Fit_Height(ByVal Target As Range)
Dim NewRwHt As Single
Dim cWdth As Single, MrgeWdth As Single
Dim c As Range, cc As Range
Dim ma As Range

Application. ScreenUpdating = False
With Target
If .MergeCells And .WrapText Then
Set c = Target.Cells(1, 1)
cWdth = c.ColumnWidth
Set ma = c.MergeArea
For Each cc In ma.Cells
MrgeWdth = MrgeWdth + cc.ColumnWidth

An additional item (clue?) is that, after the macro is done running, it is still unbearably slow to do anything on-screen. Grabbing the column header and changing the column width takes 5 seconds or so before it snaps to the desired width and displays correctly. Closing Excel and reopening it takes care of that problem.

More advancement (as I wait). It seems to be the Application.PageSetup that kills it. As soon as I hit the first Application.PageSetup line, the app grinds to a halt, and almost every line after that that manipulates the screen format or the page format takes 5 or so seconds EACH to process. I put them all at the end, but that really doesn't solve the problem, nor explain it, nor give me a true solution.

View Replies!   View Related
Copy/Paste Code Ignoring Last Row Of Data?
I am building a large macro to filter/manipulate/format/organize data pasted into a Data Dump tab.

I am a VBA novice, and I recycled some code for a portion of the macro from infomation found on this board. I just discovered that my copy/paste section is ignoring the last row of data, which is a problem ....

View Replies!   View Related
Copy And Paste And Entire Row From And To Another Excel Sheet
How do you copy and paste an entire row from and to another excel sheet, with control of where to copy and where to paste.

I have this paste sh_CIF.Cells(sh_CIF_X, "a").EntireRow.Paste

but it is wrong.

View Replies!   View Related
Copy Non-Contiguous Range & Paste To Last Used Row
I am trying to have this loop go through colums of data and compare columns 3 and 4. Where there are differences, parts of the row are copied and pasted in a summary table.

My problem is the output to the summary table.

How do I control which cells in the row are copied? (I only want to copy columns 1, 3 & 4)
How do I control where the copied cells are pasted to?

Sub Change()
Dim r As Long

'Loop to Compare Values
For r = 4 To Cells(Rows.Count, 1).End(xlUp).Row
'Looks For Funds That Upgraded
If Cells(r, 4) < Cells(r, 3) Then
'Highlights the row
Cells(r, 1).Resize(1, 5).Interior.ColorIndex = 34
'Copies The Applicable Cell Over Into Column 7
Cells(Rows.Count, 7).End(xlUp).Offset(1) = Cells(r, 1)
'Places a note into column 5
Cells(r, 5) = "UPGRADE"
End If
If Cells(r, 4) > Cells(r, 3) Then
Cells(r, 1).Resize(1, 5).Interior.ColorIndex = 36
Cells(Rows.Count, 7).End(xlUp).Offset(1) = Cells(r, 1)
Cells(r, 5) = "DOWNGRADE"
End If
Next r
End Sub

View Replies!   View Related
Copy A Range Of Data And Paste To The Last Row Of Another Workbook
I need a macro that will copy a selected range from an existing worksheet in a workbook and paste the data to the last row in another workbook on a particular worksheet.

View Replies!   View Related
Search, Copy And Paste Entire Row Into New Workbook
I need a code that will search column A over multiple sheets for a user specified value through an input box. I then need this code to copy and paste the entire row to a new workbook titled "Batch Report" Anyone have any ideas? I have a code that will copy and paste only a few rows but no where near all of them, and I cant figure out why.

View Replies!   View Related
Copy 3 Columns And Paste With Varying Row Offsets
I am trying to copy three columns of information from sheet1 into sheet2.
When pasted I need the information to be spaced or offset as per below sample.

21Dogfour legged fur ball
32Catother four legged

4four legged fur ball
7other four legged ...................

View Replies!   View Related
Find Next Empty Row And Copy And Paste Information
I want to insert some data in a number of cells (e.g. A1, B4, C4 and H8) on a worksheet ('Sheet 1').

I then want to press a button and have some code that:

Looks at column B on 'Sheet 2'
Finds the next empty row Copies and pastes the information from Sheet 1 into specific cells in that empty row.

View Replies!   View Related
Copy And Paste Data If Row In Column N Is Empty.
Copy and paste data if row in Column N is empty.
Here is my current code

View Replies!   View Related
Find Match Then Copy & Paste Into Row
I need a Macro that will search the range A6:A19 for a match to A3. Once a match is found I want contents of B3:F3 pasted in the corresponding row that the match was found in. In this example contents of B3:F3 would be pasted in B13:F13

View Replies!   View Related
Copyright © 2005-08, All rights reserved