LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Whats error messgae '400' mean?


and why does this script make it happen please

Sub MergeMove()
'
' MergeMove Macro

'
With ActiveSheet
xlastrow = .Cells(Rows.Count, 2).End(xlUp).Row
For x = 1 To xlastrow
.Cells(x, 15) = .Cells(x, 8) & " " & .Cells(x, 9) & " "
Next x
End With
'
Columns("O:O").Select
Selection.Copy
Columns("H:H").Select
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone
SkipBlanks:= _
False, Transpose:=False
Columns("I:I").Select
Application.CutCopyMode = False
Selection.Delete Shift:=xlToLeft
Columns("N:N").Select
Selection.Delete Shift:=xlToLeft
Range("H1").Select
ActiveCell.FormulaR1C1 = "Address Ln.1"
Range("H2").Select
'

Columns("G:G").Select
Selection.NumberFormat = "yyyy-mm-dd"
Columns("D:D").Select
Selection.Replace What:="", Replacement:="N/A", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False
Columns("H:H").Select
Selection.Replace What:="", Replacement:="N/A", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False
Columns("I:I").Select
Selection.Replace What:="", Replacement:="N/A", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False
Rows("1:1").Select
Selection.Replace What:="ns_no", Replacement:="NS No.", LookAt:= _
xlPart, SearchOrder:=xlByRows, MatchCase:=False
Rows("1:1").Select
Selection.Replace What:="surname", Replacement:="Surname", LookAt:
_
xlPart, SearchOrder:=xlByRows, MatchCase:=False
Rows("1:1").Select
Selection.Replace What:="forename1", Replacement:="Forename 1"
LookAt:= _
xlPart, SearchOrder:=xlByRows, MatchCase:=False
Rows("1:1").Select
Selection.Replace What:="forename2", Replacement:="Forename 2"
LookAt:= _
xlPart, SearchOrder:=xlByRows, MatchCase:=False
Rows("1:1").Select
Selection.Replace What:="title", Replacement:="Title", LookAt:= _
xlPart, SearchOrder:=xlByRows, MatchCase:=False
Rows("1:1").Select
Selection.Replace What:="sex", Replacement:="Sex", LookAt:= _
xlPart, SearchOrder:=xlByRows, MatchCase:=False
Rows("1:1").Select
Selection.Replace What:="dob", Replacement:="DOB", LookAt:= _
xlPart, SearchOrder:=xlByRows, MatchCase:=False
Rows("1:1").Select
Selection.Replace What:="house_no", Replacement:="Address Ln.1"
LookAt:= _
xlPart, SearchOrder:=xlByRows, MatchCase:=False
Rows("1:1").Select
Selection.Replace What:="road_name", Replacement:="Address Ln.2"
LookAt:= _
xlPart, SearchOrder:=xlByRows, MatchCase:=False
Rows("1:1").Select
Selection.Replace What:="town_name", Replacement:="Town", LookAt:
_
xlPart, SearchOrder:=xlByRows, MatchCase:=False
Rows("1:1").Select
Selection.Replace What:="postcode", Replacement:="Post Code"
LookAt:= _
xlPart, SearchOrder:=xlByRows, MatchCase:=False
Columns("M:M").Select
With Selection.Validation
.Delete
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop
Operator:= _
xlBetween, Formula1:="N/A,P,L,D"
.IgnoreBlank = True
.InCellDropdown = True
.InputTitle = ""
.ErrorTitle = ""
.InputMessage = "P=Newly found" & Chr(10) & "L=Left" & Chr(10
& "D=Died"
.ErrorMessage = ""
.ShowInput = True
.ShowError = True
End With
Range("L1").Select
ActiveCell.FormulaR1C1 = "PCode"
Range("M1").Select
ActiveCell.FormulaR1C1 = "Registration Details"
Cells.Select
Selection.Columns.AutoFit
With Selection
.HorizontalAlignment = xlGeneral
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.ShrinkToFit = False
.MergeCells = False
End With
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.ShrinkToFit = False
.MergeCells = False
End With
With Selection.Font
.Name = "Arial"
.Size = 8
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = xlAutomatic
End With
With Selection.Font
.Name = "Arial"
.Size = 8
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = xlAutomatic
End With
Rows("1:1").Select
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlTop
.WrapText = False
.Orientation = 0
.AddIndent = False
.ShrinkToFit = False
.MergeCells = False
End With
ActiveWindow.SmallScroll ToRight:=3
Range("M1").Select
Columns("M:M").ColumnWidth = 9.86
Columns("M:M").ColumnWidth = 10.86
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlTop
.WrapText = True
.Orientation = 0
.AddIndent = False
.ShrinkToFit = False
.MergeCells = False
End With
Columns("L:L").Select
Selection.Replace What:="", Replacement:="N8???", LookAt:=xlPart,
_
SearchOrder:=xlByRows, MatchCase:=False
Range("A1").Select
Columns("O:O").Select
Selection.Copy
Columns("H:H").Select
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone,
SkipBlanks:= _
False, Transpose:=False
Columns("I:I").Select
Application.CutCopyMode = False
Selection.Delete Shift:=xlToLeft
Columns("N:N").Select
Selection.Delete Shift:=xlToLeft
Range("H1").Select
ActiveCell.FormulaR1C1 = "Address Ln.1"
Range("H2").Select
End Sub


--
Steve M
------------------------------------------------------------------------
Steve M's Profile: http://www.excelforum.com/member.php...o&userid=32520
View this thread: http://www.excelforum.com/showthread...hreadid=524276

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Whats the best way to... Azrael Excel Worksheet Functions 0 September 13th 05 04:51 AM
Whats the best way to... Azrael Excel Worksheet Functions 0 August 18th 05 05:33 AM
Whats the best way to... Azrael Excel Worksheet Functions 1 August 16th 05 09:01 PM
Messgae Box on Exit Application patterson_m[_5_] Excel Programming 1 October 14th 03 07:17 PM
"Can't Show Modally" - Run-Time Error '400' Problem Bruce B[_2_] Excel Programming 3 July 14th 03 02:01 PM


All times are GMT +1. The time now is 02:51 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"