Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sub HeaderRecord()
ActiveCell.Cells(1, 1).Formula = "ISA~03~TX813080RP~00~ ~ZZ~17512548722~ZZ~TEX COMPTROLLER~" & Range ("YYMMDD") & "~" & Range("Time") & "~U~00401~000000093~0~P~^" ActiveCell.Cells(2, 1).Formula = "GS~TF~17512548722 ~TEX COMPTROLLER~" & Range("CCYYMMDD") & "~" & Range ("Time") & "~2~X~004010" ActiveCell.Cells(3, 1).Formula = "ST~813~0001" ActiveCell.Cells(4, 1).Formula = "BTI~T6~082~47~TX~" & Range("CCYYMMDD") & "~~~~49~17512548722~SV~00000156C~" & Range("Btilineend") ActiveCell.Cells(5, 1).Formula ="DTM~683~~~~RD8~"& CHOOSE(MOD(VALUE(INDEX(Range("Summary"),Range ("ROWSUM"+1,8)),100),31,28,31,30,31,30,31,31,30,31 ,30,31) End Sub I'm hung up right now on the line that has Cells(5,1) in it. Excel keeps giving me the message: Compile error: Expected: Expression, and it highlights the portion "MOD". I've already tested the following formula, so the "MOD" part of the formula shouldn't be a problem. The standalone formula is: ="DTM~683~~~~RD8~"&CHOOSE(MOD(VALUE(INDEX(Summary, ROWSUM+1,8)),100),31,28,31,30,31,30,31,31,30,31,30 ,31) and the result string of this formula comes out to be: DTM~683~~~~RD8~31 If I've got the syntax right on the first 4 activecell lines, then why is this one any different? Sure, it has a wild long formula, but if the formula is valid, then why won't it work in VB? I couldn't wait till Monday to play with this, so I had to go to work and get my data files and bring them back to play at home. I told you guys this project was going to be a doozy. Thanks, Bruce |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Challenging Formula Issue | Excel Worksheet Functions | |||
Challenging formatting formula | Excel Worksheet Functions | |||
Challenging Formula. Need help with writing a formula | Excel Worksheet Functions | |||
challenging formula(for me), counting days between dates for multipleyears | Excel Worksheet Functions | |||
Answers needed for challenging formula | Excel Worksheet Functions |