I am trying to copy entire rows that have a value in column A from an entry worksheet - starts at A10 (Sheet1) to the next empty line in a sales record worksheet(Sales), then clear the entry worksheet. I am very new to VBA coding. I also have a hidden column in the entry worksheet with contains a TODAY() Forumla the actual result needs to also be copied - in fact there are a number or formula in the entry worksheet. Both appeared to be working this morning however as I have renamed sheets - and modified the names in the formula while working on other things today I seem to have lost all but the first row when I run the marco. Can any one point out where I am going wrong please: Code as follows:
Sorry if I have posted this wrong - not sure how to load the code differently than this - Like I say I am new at this I bit off a little more than I can chew but need to get the workbook working. Yes I did save three different copies but the error has occured prior to the first save.![]()
Sub CopyRowC() Dim ws As Worksheet Dim r As Range Set ws = Worksheets("Sales") Set r = Range("A10", Range("A65536").End(xlUp)) For Each c In r.Cells If c <> "" Then c.EntireRow.Copy Destination:=ws.Range("A65536").End(xlUp).Offset(1, 0) Cells.Select Selection.SpecialCells(xlCellTypeConstants, 1).Select Selection.ClearContents End If Next MsgBox "Thankyou the sales records have been updated" End Sub
I am sure the answer is staring me in the face -
Thanks
Kazza
Bookmarks