Skip to main content
deleted 196 characters in body
Source Link
Gaffi
  • 3.7k
  • 2
  • 23
  • 54

VBA: (300+268251+216)/2/2 = 142116.75

300251

Sub a()
c = "Ifr=vbCrLf:c="If b.Lines(54, 4) = c Then" & vbCr & vbLf &Then"&r "b&"b.InsertLines 98, d" & vbCr & vbLf &d"&r "b&"b.DeleteLines 54, 4" & vbCr & vbLf &4"&r "End&"End If"
d = "b:d="b.InsertLines 76, c" & vbCr & vbLf &c"&r "b&"b.DeleteLines 54, 2"
Set b = Modulesb=Modules("Q")
If b.Lines(54, 4) = c Then
b.InsertLines 98, d
b.DeleteLines 54, 4
End If
End Sub

268216

Sub a()
c = "Ifr=vbCrLf:c="If b.Lines(54, 4) = c Then" & vbCr & vbLf &Then"&r "b&"b.InsertLines 98, d" & vbCr & vbLf &d"&r "b&"b.DeleteLines 54, 4" & vbCr & vbLf &4"&r "End&"End If"
d = "b:d="b.InsertLines 76, c" & vbCr & vbLf &c"&r "b&"b.DeleteLines 54, 2"
Set b = Modulesb=Modules("Q")
b.InsertLines 76, c
b.DeleteLines 54, 2
End Sub

This is run in MSAccess to make use of the Module object. The module is named "Q" for golfing. The difference in syntax comes from the If ... Then missing from the shorter version.

This can probably be expanded to another function, but I haven't gotten that far yet.

VBA: (300+268)/2/2 = 142

300

Sub a()
c = "If b.Lines(5, 4) = c Then" & vbCr & vbLf & "b.InsertLines 9, d" & vbCr & vbLf & "b.DeleteLines 5, 4" & vbCr & vbLf & "End If"
d = "b.InsertLines 7, c" & vbCr & vbLf & "b.DeleteLines 5, 2"
Set b = Modules("Q")
If b.Lines(5, 4) = c Then
b.InsertLines 9, d
b.DeleteLines 5, 4
End If
End Sub

268

Sub a()
c = "If b.Lines(5, 4) = c Then" & vbCr & vbLf & "b.InsertLines 9, d" & vbCr & vbLf & "b.DeleteLines 5, 4" & vbCr & vbLf & "End If"
d = "b.InsertLines 7, c" & vbCr & vbLf & "b.DeleteLines 5, 2"
Set b = Modules("Q")
b.InsertLines 7, c
b.DeleteLines 5, 2
End Sub

This is run in MSAccess to make use of the Module object. The module is named "Q" for golfing. The difference in syntax comes from the If ... Then missing from the shorter version.

This can probably be expanded to another function, but I haven't gotten that far yet.

VBA: (251+216)/2/2 = 116.75

251

Sub a()
r=vbCrLf:c="If b.Lines(4, 4) = c Then"&r &"b.InsertLines 8, d"&r &"b.DeleteLines 4, 4"&r &"End If":d="b.InsertLines 6, c"&r &"b.DeleteLines 4, 2"
Set b=Modules("Q")
If b.Lines(4, 4) = c Then
b.InsertLines 8, d
b.DeleteLines 4, 4
End If
End Sub

216

Sub a()
r=vbCrLf:c="If b.Lines(4, 4) = c Then"&r &"b.InsertLines 8, d"&r &"b.DeleteLines 4, 4"&r &"End If":d="b.InsertLines 6, c"&r &"b.DeleteLines 4, 2"
Set b=Modules("Q")
b.InsertLines 6,c
b.DeleteLines 4,2
End Sub

This is run in MSAccess to make use of the Module object. The module is named "Q" for golfing. The difference in syntax comes from the If ... Then missing from the shorter version.

Corrected Score - Spaces Matter
Source Link
Gaffi
  • 3.7k
  • 2
  • 23
  • 54

VBA: (284+252300+268)/2/2 = 134142

284300

Sub a()
c="Ifc = "If b.Lines(5, 4)=c = c Then" & vbCr & vbLf & "b.InsertLines 9, d" & vbCr & vbLf & "b.DeleteLines 5, 4" & vbCr & vbLf & "End If"
d="bd = "b.InsertLines 7, c" & vbCr & vbLf & "b.DeleteLines 5, 2"
Set b = Modules("Q")
If b.Lines(5, 4)=c = c Then
b.InsertLines 9, d
b.DeleteLines 5, 4
End If
End Sub

252268

Sub a()
c="Ifc = "If b.Lines(5, 4)=c = c Then" & vbCr & vbLf & "b.InsertLines 9, d" & vbCr & vbLf & "b.DeleteLines 5, 4" & vbCr & vbLf & "End If"
d="bd = "b.InsertLines 7, c" & vbCr & vbLf & "b.DeleteLines 5, 2"
Set b=Modulesb = Modules("Q")
b.InsertLines 7, c
b.DeleteLines 5, 2
End Sub

This is run in MSAccess to make use of the Module object. The module is named "Q" for golfing. The difference in syntax comes from the If ... Then missing from the shorter version.

This can probably be expanded to another function, but I haven't gotten that far yet.

VBA: (284+252)/2/2 = 134

284

Sub a()
c="If b.Lines(5,4)=c Then" & vbCr & vbLf & "b.InsertLines 9,d" & vbCr & vbLf & "b.DeleteLines 5,4" & vbCr & vbLf & "End If"
d="b.InsertLines 7,c" & vbCr & vbLf & "b.DeleteLines 5,2"
Set b = Modules("Q")
If b.Lines(5,4)=c Then
b.InsertLines 9,d
b.DeleteLines 5,4
End If
End Sub

252

Sub a()
c="If b.Lines(5,4)=c Then" & vbCr & vbLf & "b.InsertLines 9,d" & vbCr & vbLf & "b.DeleteLines 5,4" & vbCr & vbLf & "End If"
d="b.InsertLines 7,c" & vbCr & vbLf & "b.DeleteLines 5,2"
Set b=Modules("Q")
b.InsertLines 7,c
b.DeleteLines 5,2
End Sub

This is run in MSAccess to make use of the Module object. The module is named "Q" for golfing. The difference in syntax comes from the If ... Then missing from the shorter version.

This can probably be expanded to another function, but I haven't gotten that far yet.

VBA: (300+268)/2/2 = 142

300

Sub a()
c = "If b.Lines(5, 4) = c Then" & vbCr & vbLf & "b.InsertLines 9, d" & vbCr & vbLf & "b.DeleteLines 5, 4" & vbCr & vbLf & "End If"
d = "b.InsertLines 7, c" & vbCr & vbLf & "b.DeleteLines 5, 2"
Set b = Modules("Q")
If b.Lines(5, 4) = c Then
b.InsertLines 9, d
b.DeleteLines 5, 4
End If
End Sub

268

Sub a()
c = "If b.Lines(5, 4) = c Then" & vbCr & vbLf & "b.InsertLines 9, d" & vbCr & vbLf & "b.DeleteLines 5, 4" & vbCr & vbLf & "End If"
d = "b.InsertLines 7, c" & vbCr & vbLf & "b.DeleteLines 5, 2"
Set b = Modules("Q")
b.InsertLines 7, c
b.DeleteLines 5, 2
End Sub

This is run in MSAccess to make use of the Module object. The module is named "Q" for golfing. The difference in syntax comes from the If ... Then missing from the shorter version.

This can probably be expanded to another function, but I haven't gotten that far yet.

Source Link
Gaffi
  • 3.7k
  • 2
  • 23
  • 54

VBA: (284+252)/2/2 = 134

284

Sub a()
c="If b.Lines(5,4)=c Then" & vbCr & vbLf & "b.InsertLines 9,d" & vbCr & vbLf & "b.DeleteLines 5,4" & vbCr & vbLf & "End If"
d="b.InsertLines 7,c" & vbCr & vbLf & "b.DeleteLines 5,2"
Set b = Modules("Q")
If b.Lines(5,4)=c Then
b.InsertLines 9,d
b.DeleteLines 5,4
End If
End Sub

252

Sub a()
c="If b.Lines(5,4)=c Then" & vbCr & vbLf & "b.InsertLines 9,d" & vbCr & vbLf & "b.DeleteLines 5,4" & vbCr & vbLf & "End If"
d="b.InsertLines 7,c" & vbCr & vbLf & "b.DeleteLines 5,2"
Set b=Modules("Q")
b.InsertLines 7,c
b.DeleteLines 5,2
End Sub

This is run in MSAccess to make use of the Module object. The module is named "Q" for golfing. The difference in syntax comes from the If ... Then missing from the shorter version.

This can probably be expanded to another function, but I haven't gotten that far yet.