- Joined
- Apr 12, 2013
- Messages
- 1
- Reaction score
- 0
Problem:
Problem:we have 12 differents sheets named by mounth (January-December).The thirteen master sheet called "skupno". Sheets have the same number of columns( thirteen) and different numbers of rows.
question:
How fix this VBA macro that will automatically update data.(subsequent changes in this sheets should be updated)?
macro:
Sub kroko()
For Each sh In Worksheets
If sh.Name <> "Skupno" Or sh.Name <> "Skupno" Then
lrsh = Sheets(sh.Name).Range("B" & Rows.Count).End(xlUp).Row
If lrsh = 1 Then Exit Sub
lrm = Sheets("Skupno").Range("A" & Rows.Count).End(xlUp).Row + 1
Sheets(sh.Name).Range("A1:M" & lrsh).Copy Sheets("Skupno").Range("A" & lrm)
End If
Next sh
End Sub
Problem:we have 12 differents sheets named by mounth (January-December).The thirteen master sheet called "skupno". Sheets have the same number of columns( thirteen) and different numbers of rows.
question:
How fix this VBA macro that will automatically update data.(subsequent changes in this sheets should be updated)?
macro:
Sub kroko()
For Each sh In Worksheets
If sh.Name <> "Skupno" Or sh.Name <> "Skupno" Then
lrsh = Sheets(sh.Name).Range("B" & Rows.Count).End(xlUp).Row
If lrsh = 1 Then Exit Sub
lrm = Sheets("Skupno").Range("A" & Rows.Count).End(xlUp).Row + 1
Sheets(sh.Name).Range("A1:M" & lrsh).Copy Sheets("Skupno").Range("A" & lrm)
End If
Next sh
End Sub