ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   copy all but formula to next empty column (https://www.excelbanter.com/excel-programming/418927-copy-all-but-formula-next-empty-column.html)

Miree

copy all but formula to next empty column
 
I have a data entry sheet, to begin with data can only be entered into the
range G5:H59(some of the cells are merged).

I want to be able to search for the next empty cell, along row 5 then copy
all the formating calculations and data validation from G5:H59 to the
avalible column.

Thanks

joel

copy all but formula to next empty column
 
Try this code

Sub CopyFormat()

For RowCount = 5 To 59
If Range("G" & RowCount) < "" Then
LastCol = Cells(RowCount, Columns.Count).End(xlToLeft).Column

Range("G" & RowCount).Copy
Cells(RowCount, LastCol + 1).PasteSpecial _
Paste:=xlPasteFormats, _
Paste:=xlPasteValidation
End If

Next RowCount

End Sub


"Miree" wrote:

I have a data entry sheet, to begin with data can only be entered into the
range G5:H59(some of the cells are merged).

I want to be able to search for the next empty cell, along row 5 then copy
all the formating calculations and data validation from G5:H59 to the
avalible column.

Thanks



All times are GMT +1. The time now is 02:09 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com