DOSYA İndirmek/Yüklemek için ÜCRETLİ ALTIN ÜYELİK Gereklidir!
Altın Üyelik Hakkında Bilgi
[SIZE="2"]Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 1 And Target.Row > 1 Then
Application.EnableEvents = False
Range("A1").Copy Target
Application.EnableEvents = True
End If
End Sub[/SIZE]
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
If Intersect(Target, [A:A]) And Target.Row = 1 Then Exit Sub
Target.Value = Range("A1")
End Sub
Merhaba,
Bu isteği pek mantıklı bulmadım, nerede kullanılabilir ki? Merak ettim doğrusu.
A sütununda bir değişiklik yapıldığında A1 hücresini oraya kopyalamaktansa A sütununda her hangi bir hücreye çift tıklamakla da (A1 hücresi hariç) A1 hücresini kopyalayabilirsiniz.
Kod:Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean) If Intersect(Target, [A:A]) And Target.Row = 1 Then Exit Sub Target.Value = Range("A1") End Sub
Bu kodları sayfanın kod penceresine yapıştırarak kullanabilirsiniz..
Kod:[SIZE="2"]Private Sub Worksheet_Change(ByVal Target As Range) If Target.Column = 1 And Target.Row > 1 Then Application.EnableEvents = False Range("A1").Copy Target Application.EnableEvents = True End If End Sub[/SIZE]
Bu kodları sayfanın kod penceresine yapıştırarak kullanabilirsiniz..
Kod:[SIZE="2"]Private Sub Worksheet_Change(ByVal Target As Range) If Target.Column = 1 And Target.Row > 1 Then Application.EnableEvents = False Range("A1").Copy Target Application.EnableEvents = True End If End Sub[/SIZE]
Merhaba,
Bu isteği pek mantıklı bulmadım, nerede kullanılabilir ki? Merak ettim doğrusu.
A sütununda bir değişiklik yapıldığında A1 hücresini oraya kopyalamaktansa A sütununda her hangi bir hücreye çift tıklamakla da (A1 hücresi hariç) A1 hücresini kopyalayabilirsiniz.
Kod:Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean) If Intersect(Target, [A:A]) And Target.Row = 1 Then Exit Sub Target.Value = Range("A1") End Sub
[SIZE="2"]Private Sub Worksheet_Change(ByVal Target As Range)
If Selection.Cells.Count <> 1 Then Exit Sub
If Target.Value = "" Then Exit Sub
If Intersect(Target, [B:I]) Is Nothing Then Exit Sub
Application.EnableEvents = False
If WorksheetFunction.CountIf(Range("B" & Target.Row & ":I" & Target.Row), "") < 7 Then
MsgBox "Bu satırda zaten veri var"
Target.Value = ""
Application.EnableEvents = True
Exit Sub
End If
[COLOR="Red"]Range("B" & Target.Row & ":I" & Target.Row).Clear[/COLOR]
Cells(1, Target.Column).Copy Target
Application.EnableEvents = True
End Sub[/SIZE]
Merhaba
Ek dosyadaki gibi denermisiniz?
http://s7.dosya.tc/server/o9s9zr/Deneme.zip.html
Kod:[SIZE="2"]Private Sub Worksheet_Change(ByVal Target As Range) If Selection.Cells.Count <> 1 Then Exit Sub If Target.Value = "" Then Exit Sub If Intersect(Target, [B:I]) Is Nothing Then Exit Sub Application.EnableEvents = False If WorksheetFunction.CountIf(Range("B" & Target.Row & ":I" & Target.Row), "") < 7 Then MsgBox "Bu satırda zaten veri var" Target.Value = "" Application.EnableEvents = True Exit Sub End If Range("B" & Target.Row & ":I" & Target.Row).ClearFormats Cells(1, Target.Column).Copy Target Application.EnableEvents = True End Sub[/SIZE]
Merhaba
Çerçevelerin silinmemesi isteğiniz için; yukarıdaki (9.mesajdaki) değişen kırmızı bölüm gibi kullanın.
Birinci isteğiniz:
"B:I" aralığında çalışan kodlar mesela "L:I" aralığındada çalışsın istiyorsunuz?
Ek dosyada buna göre ekleme yapmaya çalıştım, bakarsınızo satırın biçiminin silinip, yukarıdaki kutuyu kopyaladıktan sonra, silinen çerçevelerin tekrar getirilmesi.
Bu anlatımınıza göre ek dosyayı deneyinizörnek veriyorum. "B4:G30" aralığını komple seçip, kestikten sonra "C4:H30" a yapıştırmak istiyorum. bunu yaptığımda numaralar değişmiyor biçimleriyle. tek tek tüm kutulara birşey girip enterlamam gerekiyor.
[SIZE="2"]Private Sub Workbook_BeforeClose(Cancel As Boolean)
Application.OnKey "^{b}"
End Sub
Private Sub Workbook_Open()
Application.OnKey "^{b}", "kes_kopya"
End Sub[/SIZE]
[SIZE="2"]Sub kes_kopya()
[COLOR="Red"]If Selection.Cells.Count > 1 Then[/COLOR]
If Intersect(ActiveCell, [B:I]) Is Nothing Or Application.CutCopyMode = 0 Then Exit Sub
Selection.PasteSpecial
For Each j In Selection.Cells
If j.Row = 1 Then MsgBox "Kes-kopyala 2.satırdan itibaren olmalıdır": Application.CutCopyMode = False: Exit Sub
If j.Value <> "" Then
x = j.Address
With Range("B" & j.Row & ":I" & j.Row)
.ClearFormats
.Value = ""
End With
Cells(1, j.Column).Copy Range(x)
Range("B" & j.Row & ":I" & j.Row).Borders.Weight = xlThin
End If
Next
[COLOR="Red"]End If[/COLOR]
End Sub[/SIZE]
[SIZE="2"]Private Sub Worksheet_Change(ByVal Target As Range)
If Selection.Cells.Count <> 1 Then Exit Sub
If Target.Value = "" Then Exit Sub
If Intersect(Target, [B:I]) Is Nothing Then Exit Sub
Application.EnableEvents = False
If WorksheetFunction.CountIf(Range("B" & Target.Row & ":I" & Target.Row), "") < 7 Then
MsgBox "Bu satırda zaten veri var"
Target.Value = ""
Application.EnableEvents = True
Exit Sub
End If
[COLOR="Blue"]With Range("B" & Target.Row & ":I" & Target.Row)
.ClearFormats
.Value = ""
End With
Range("A" & Target.Row & ":I" & Target.Row).Borders.Weight = xlThin[/COLOR]
Cells(1, Target.Column).Copy Target
Application.EnableEvents = True
End Sub
[/SIZE]
"B4:G30" aralığını kesip/kopyalayıp,yapıştıracağınız aralığı seçip; "CTRL+b" ile yapıştırın.
Kopyaladıktan sonra yapıştırılacak bölümde tek hücre seçip yapıştırmak için aşağıdaki "kes_kopya" makrosunda kırmızı bölümleri silip deneyin.
(eğer bu kombinasyonun sakıncası varsa buton veya düğme ile yaparız)
Merhaba
"Kes-yapıştırda" tek hücreyi denememiştim
Hata veren satırda:
"Selection pastespecial" yerineKod:activesheet.paste
Merhaba
"Kes-yapıştırda" tek hücreyi denememiştim
Hata veren satırda:
"Selection pastespecial" yerineKod:activesheet.paste
Ek dosyayı deneyin, geri alma işleminde hata ile karşılaşırsanız, variant yerinehocam bu kodlar, herhangi bir geri dönüş yapmak istediğimizde "ctrl+z" ye izin verebilir mi?
[SIZE="2"]Private Sub Worksheet_BeforeRightClick(ByVal Target As Range, Cancel As Boolean)
If Application.CutCopyMode = 0 Then Call deg
End Sub
ilgili sayfa kodları
Private Sub Worksheet_Change(ByVal Target As Range)
If mr <> Empty Then Exit Sub
If Selection.Cells.Count <> 1 Then Exit Sub
If Intersect(Target, [B:I]) Is Nothing Then Exit Sub
If Target.Value = "" Then Exit Sub
Application.EnableEvents = False
If WorksheetFunction.CountIf(Range("B" & Target.Row & ":I" & Target.Row), "") < 7 Then
MsgBox "Bu satırda zaten veri var"
Target.Value = ""
Application.EnableEvents = True
Exit Sub
End If
With Range("B" & Target.Row & ":I" & Target.Row)
.ClearFormats
.Value = ""
End With
Range("A" & Target.Row & ":I" & Target.Row).Borders.Weight = xlThin
Cells(1, Target.Column).Copy Target
Application.EnableEvents = True
End Sub[/SIZE]
[SIZE="2"]
Sub kes_kopya()
'If Selection.Cells.Count > 1 Then
If Intersect(ActiveCell, [B:I]) Is Nothing Or Application.CutCopyMode = 0 Then Exit Sub
ActiveSheet.Paste
For Each j In Selection.Cells
If j.Row = 1 Then MsgBox "Kes-kopyala 2.satırdan itibaren olmalıdır": Application.CutCopyMode = False: Exit Sub
If j.Value <> "" Then
x = j.Address
With Range("B" & j.Row & ":I" & j.Row)
.ClearFormats
.Value = ""
End With
Cells(1, j.Column).Copy Range(x)
Range(mr).Borders.Weight = xlThin [COLOR="Blue"]'bu satır hata verirse silip, alt satırı kullanın[/COLOR]
'Range("B" & j.Row & ":I" & j.Row).Borders.Weight = xlThin
End If
Next
'End If
End Sub[/SIZE]
[SIZE="2"]Public m As Variant
Public mr As String
Sub deg()
mr = Empty
a = Selection.Cells.Row
b = Selection.Cells.Rows.Count + a - 1
m = Range("B" & a & ":I" & b).Value
mr = Range("B" & a & ":I" & b).Address
End Sub
Sub gerial()
If mr <> "" Then
With Range(mr)
.ClearFormats
.Value = ""
.Borders.Weight = xlThin
End With
Range(mr).Value = m
For Each j In Range(mr)
If j.Value <> "" Then Cells(1, j.Column).Copy j
Next
mr = Empty
End If
End Sub[/SIZE]
Ek dosyayı deneyin, geri alma işleminde hata ile karşılaşırsanız, variant yerine
bir yardımcı sütun veya sayfa ile yaparız
Kod:Range(mr).Borders.Weight = xlThin [COLOR="Blue"]'bu satır hata verirse silip, alt satırı kullanın[/COLOR] 'Range("B" & j.Row & ":I" & j.Row).Borders.Weight = xlThin
Merhabasadece dediğiniz satır hata verdi onu da aşağıdakini kullanarak hallettim.
hata vermiyor hocam ama geri almıyor.