- Katılım
- 12 Mart 2009
- Mesajlar
- 119
- Excel Vers. ve Dili
- Office 365 - Ingilizce
Merhabalar.
Elimdeki macro bir sekmede sorunsuz calisiyor fakat ayni macroyu diger sekmelerdede kullanmak istedigimde bunu basaramiyorum. Ikinci sekmeye gecmeden once araya ne koymam gerekiyor cozemedim. Yardimci olabilirseniz cok sevinirim.
Sub deletetabs()
'
' deletetabs Macro
'
'
Sheets("SRKO").Select
If IsEmpty(Range("A2")) = False Then
Dim str As String
Dim n As Integer
str = ActiveCell.Value
Cells(n + 1, 4).Select
Do Until Len(str) = 0
n = n + 1
Cells(n + 1, 4).Select
str = ActiveCell.Value
Cells(n + 1, 4).Value = Left(str, 11) & "-" & Right(str, 1)
Loop
Selection.EntireRow.Delete
Else
End If
Application.DisplayAlerts = False
Sheets("SRKO").Select
ActiveWindow.SelectedSheets.Delete
Application.DisplayAlerts = True
____________ Ikinci sekmeye gecis____________
Sheets("ZUS").Select
If IsEmpty(Range("A2")) = False Then
Dim str As String
Dim n As Integer
str = ActiveCell.Value
Cells(n + 1, 4).Select
Do Until Len(str) = 0
n = n + 1
Cells(n + 1, 4).Select
str = ActiveCell.Value
Cells(n + 1, 4).Value = Left(str, 11) & "-" & Right(str, 1)
Loop
Selection.EntireRow.Delete
Else
End If
Application.DisplayAlerts = False
Sheets("ZUS").Select
ActiveWindow.SelectedSheets.Delete
Application.DisplayAlerts = True
End Sub
Elimdeki macro bir sekmede sorunsuz calisiyor fakat ayni macroyu diger sekmelerdede kullanmak istedigimde bunu basaramiyorum. Ikinci sekmeye gecmeden once araya ne koymam gerekiyor cozemedim. Yardimci olabilirseniz cok sevinirim.
Sub deletetabs()
'
' deletetabs Macro
'
'
Sheets("SRKO").Select
If IsEmpty(Range("A2")) = False Then
Dim str As String
Dim n As Integer
str = ActiveCell.Value
Cells(n + 1, 4).Select
Do Until Len(str) = 0
n = n + 1
Cells(n + 1, 4).Select
str = ActiveCell.Value
Cells(n + 1, 4).Value = Left(str, 11) & "-" & Right(str, 1)
Loop
Selection.EntireRow.Delete
Else
End If
Application.DisplayAlerts = False
Sheets("SRKO").Select
ActiveWindow.SelectedSheets.Delete
Application.DisplayAlerts = True
____________ Ikinci sekmeye gecis____________
Sheets("ZUS").Select
If IsEmpty(Range("A2")) = False Then
Dim str As String
Dim n As Integer
str = ActiveCell.Value
Cells(n + 1, 4).Select
Do Until Len(str) = 0
n = n + 1
Cells(n + 1, 4).Select
str = ActiveCell.Value
Cells(n + 1, 4).Value = Left(str, 11) & "-" & Right(str, 1)
Loop
Selection.EntireRow.Delete
Else
End If
Application.DisplayAlerts = False
Sheets("ZUS").Select
ActiveWindow.SelectedSheets.Delete
Application.DisplayAlerts = True
End Sub