copy all but formula to next empty column

M

Miree

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
 
J

Joel

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top