PDA

View Full Version : [SOLVED] Code limits its operation



osevero
11-10-2013, 10:21 PM
Hi!

I have this code that writes data from one worksheet to another.


Sub Save()


Dim ws1 As Worksheet
Dim ws2 As Worksheet
Dim lngRC As Long
Dim var


Set ws1 = Sheets("Sheet1")
Set ws2 = Sheets("Sheet2")


With ws2
lngFF = .Range("B" & Rows.Count).End(xlUp).Row + 1
End With


var = Array(6, 11, 8, 12, 13, 14, 15, 16, 17, 18, 19, 20, 22, 53, 56, 57, 58)


For lngRC = LBound(var) To UBound(var)
ws2.Cells(lngFF, lngRC + 2).Value = ws1.Cells(var(lngRC), "C").Value
Next lngRC


ws1.Range("C7:C8").ClearContents
ws1.Range("C10").ClearContents
ws1.Range("C12:C15").ClearContents
ws1.Range("C17:C19").ClearContents
ws1.Range("C28:F47").ClearContents


Set ws2 = Nothing
Set ws1 = Nothing


End Sub


But I want to limit this code only works if cell C53 has some data. If cell C53 doesn't have any number, then a message: "You must fill in more data". If the cell C53 has number, then the code proceeds.

osevero
11-10-2013, 11:06 PM
Have already succeeded help me here: http://www.excelforum.com/excel-programming-vba-macros/967503-code-limits-its-operation.html#post3470840

:)

Cheers

Aussiebear
11-18-2013, 08:04 PM
To view that solution you need to join that particular forum. Since you raised the issue here as well then kindly post the solution so that others can easily follow the issue