Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 45
Default run macro text missing

dear all, pls help.

Branch No Customer Def Value Company Date
14213 0091 000100 ABC 15102004

should be this
142130091000100ABC 15102004

but when run macro is this
14213009100010015102004


thanks alot.


sample as below...

Sub MHeader1()
'
' MHeader1 Macro
' Macro recorded 15/10/2004 by
'

'
ActiveCell.FormulaR1C1 = _
"=IF(LEN(R[-2]C)<20,R[-2]C&REPT("" "",20-LEN(R[-2]C)),LEFT(R[-2]C,20))"
Range("D4").Select
Selection.Copy
Range("D6").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("E2").Select
Application.CutCopyMode = False
Selection.Copy
Range("E6").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("L2").Select
Application.CutCopyMode = False
ActiveCell.FormulaR1C1 = _
"=CONCATENATE(RC[-11],RC[-10],RC[-9],R[4]C[-8],R[4]C[-7])"
Range("L2").Select
Selection.Copy
Range("M2").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Selection.Copy
Sheets("Final").Select
Range("A1").Select
ActiveSheet.Paste
Sheets("Header").Select
ActiveWindow.LargeScroll ToRight:=-1
ActiveWindow.ScrollColumn = 2
ActiveWindow.ScrollColumn = 3
ActiveWindow.ScrollColumn = 4
ActiveWindow.ScrollColumn = 5
ActiveWindow.ScrollColumn = 6
ActiveWindow.ScrollColumn = 7
ActiveWindow.ScrollColumn = 8
Range("M2").Select
Application.CutCopyMode = False
Selection.ClearContents
Range("L2").Select
Selection.ClearContents
ActiveWindow.SmallScroll ToRight:=-7
Range("E6").Select
Selection.ClearContents
Range("D6").Select
Selection.ClearContents
Range("D4").Select
Selection.ClearContents
Range("D2").Select
Selection.ClearContents
End Sub
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,253
Default run macro text missing

Try this..
it's a bit shorter
hope that isn't a probelm
<g
Sub Macro1()

Range("Final!A1").Value = _
Format(Range("Header!a2"), "00000") & _
Format(Range("Header!b2"), "0000") & _
Format(Range("Header!c2"), "000000") & _
Left(Range("Header!d2") & Space(20), 20) & _
Format(Range("Header!e2"), "00000000")
End Sub


keepITcool

< email : keepitcool chello nl (with @ and .)
< homepage: http://members.chello.nl/keepitcool


(tango) wrote:

dear all, pls help.

Branch No Customer Def Value Company Date
14213 0091 000100 ABC 15102004

should be this
142130091000100ABC 15102004

but when run macro is this
14213009100010015102004


thanks alot.


Reply
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
Missing text ann Excel Discussion (Misc queries) 1 January 13th 10 06:24 PM
macro to sort is missing top row out??? Romileyrunner1 Excel Worksheet Functions 4 September 28th 09 08:59 PM
Macro - Code Missing Shane Excel Discussion (Misc queries) 4 August 4th 09 08:53 AM
Missing Macro Tim at alliant Excel Worksheet Functions 7 December 11th 08 09:29 PM
Assign to macro missing Paul Excel Discussion (Misc queries) 2 January 22nd 05 09:55 AM


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

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

About Us

"It's about Microsoft Excel"