View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Mike H Mike H is offline
external usenet poster
 
Posts: 11,501
Default ROW CELLS SHOULD HAVE VALUE WHEN WORKBOOK OPEN

Hi,

If I've understood correctly, try this. Alt+F11 to open Vb editor. Double
click 'This Workbook' and paste this in on the right.

Private Sub Workbook_Open()
Lastrow = Sheets("Sheet1").Cells(Rows.Count, "A").End(xlUp).Row
If Lastrow < 10 Then
With Sheets("Sheet1")
.Range("A" & Lastrow + 1).Value = "KK"
.Range("B" & Lastrow + 1).Value = "Ford"
.Range("C" & Lastrow + 1).Value = "VR"
End With
End If
End Sub

Mike

"K" wrote:

Hi all, I need macro that when i open my Workbook i should have (see
below)

in row 2 cells from coloumn A to C
cell A2 value = "KK"
cell B2 value = "Ford"
cell C2 value= "VR"

and when i open my workbook again now i should get same thing but in
row 3 and it should continue when ever i open my workbook until row
10. And when in row 10 from column A to C i have values in cells A10 ,
B10 and C10 (the values metioned above) i should not get anything in
row 11 and now when ever i'll open my workbook macro should exit . in
other words i want macro to put values when ever i open the workbook
in each row cells form coloumn A to C and once cell A10 to C10 in row
10 have values now macro should exit and not donot do any thing. I
hope i was able to expalin my question. Please can any friend can help