vba line input not recognizing end of line

I had this problem, and saw others had it as well; I just wanted to
post my solution which turned out to be simple (in code).

For years I've been parsing a csv download file using the standard vba
line input function.  Well, the download file is still a csv, but
longer has CRLF, just LF.  As a result,  the line input function now
reads the entire file at once, instead of line by line.  To solve it,
I just used the replace function:

sub mproFileLineInput.

Open "c:\NeededFile.csv" For Input As #1     'Open download file

Line Input #1, txtline    'read line input, which reads entire file
because no CR Chr(13), just LF Chr(10)
NewText=Replace(txtline, Chr(10), vbCrLf)  'Find all Chr(10) LF and
replace with CRLR

Close #1

Open "c:\NeededFile.csv" For output As #1  'Open file again, but for
output this time
Print #1, NewTxtLine  'use print function to write contents, but with
LF replaced by CRLF
Close #1

End sub

Hope it helps anyone with same problem.
1
Beancounter
6/7/2010 4:17:32 PM
vb.general.discussion 1016 articles. 0 followers. Follow

15 Replies
12435 Views

Similar Articles

[PageSpeed] 40

"Beancounter" <jonescpa@gmail.com> skrev i meddelandet 
news:b9395c52-f604-4c9d-9ce4-f3e255ca7a45@d37g2000yqm.googlegroups.com...
>I had this problem, and saw others had it as well; I just wanted to
> post my solution which turned out to be simple (in code).
>
> For years I've been parsing a csv download file using the standard vba
> line input function.  Well, the download file is still a csv, but
> longer has CRLF, just LF.  As a result,  the line input function now
> reads the entire file at once, instead of line by line.  To solve it,
> I just used the replace function:
>
> sub mproFileLineInput.
>
> Open "c:\NeededFile.csv" For Input As #1     'Open download file
>
> Line Input #1, txtline    'read line input, which reads entire file
> because no CR Chr(13), just LF Chr(10)
> NewText=Replace(txtline, Chr(10), vbCrLf)  'Find all Chr(10) LF and
> replace with CRLR
>
> Close #1
>
> Open "c:\NeededFile.csv" For output As #1  'Open file again, but for
> output this time
> Print #1, NewTxtLine  'use print function to write contents, but with
> LF replaced by CRLF
> Close #1
>
> End sub
>
> Hope it helps anyone with same problem.

Just read here or there that someone deliberately saved files in that 
format. For me it's a big why?? to save some CR's? Or is it to ease for 
mac'ers to read the files?

Your example shows the outcome of same row-delimiter-change.

/Henning


0
Henning
6/7/2010 5:48:50 PM
"Henning" <computer_hero@coldmail.com> schrieb im Newsbeitrag 
news:hujbe3$bk8$1@news.eternal-september.org...
>
> Just read here or there that someone deliberately saved files in that format. 
> For me it's a big why?? to save some CR's? Or is it to ease for mac'ers to 
> read the files?
>
> Your example shows the outcome of same row-delimiter-change.
>
> /Henning
>


Henning,

a LF without a CR is UNIX, Linux, AmigaOS and now Mac -
since Mac OS X.
Until Mac OS version 9 the Mac was usung a single CR without
a LF. Same for the Apple II.
CR+LF is Windows, DOS, OS/2, CP/M, Atari TOS.

For the old teletypes you needed both CR + LF.
In the mid-seventies I saw a program using a teletype as "printer".
They used multiple CR without a LF to write columns.
With a teletype you had to send first the CR (carriage return) then
the LF (line feed) due to the latency time of the mechanical equipment.
If you did it the other way, the first character of the new line was
printed somewhere to the right, not in the leftmost position.

Helmut.


1
Helmut
6/7/2010 6:18:40 PM
Henning wrote:
....

> Just read here or there that someone deliberately saved files in that 
> format. For me it's a big why?? to save some CR's? Or is it to ease for 
> mac'ers to read the files?
> 
> Your example shows the outcome of same row-delimiter-change.
....

It's Unix-ish; I commented on the same posting not long ago that it's 
not wise to do so for Windows platforms in that there is much that doing 
so may unexpectedly break when the files are used for anything other 
than an app that knows to expect it.

--
0
dpb
6/7/2010 6:59:23 PM
Beancounter wrote:
> I had this problem, and saw others had it as well; I just wanted to
> post my solution which turned out to be simple (in code).
>
> For years I've been parsing a csv download file using the standard
> vba line input function.  Well, the download file is still a csv,
> but longer has CRLF, just LF.  As a result,  the line input
> function now reads the entire file at once, instead of line by
> line.  To solve it, I just used the replace function:
>
> sub mproFileLineInput.
>
> Open "c:\NeededFile.csv" For Input As #1     'Open download file
>
> Line Input #1, txtline    'read line input, which reads entire file
> because no CR Chr(13), just LF Chr(10)
> NewText=Replace(txtline, Chr(10), vbCrLf)  'Find all Chr(10) LF and
> replace with CRLR
>
> Close #1
>
> Open "c:\NeededFile.csv" For output As #1  'Open file again, but for
> output this time
> Print #1, NewTxtLine  'use print function to write contents, but
> with LF replaced by CRLF
> Close #1
>

FWIW, if you need to do this often or quickly, there's a faster way
(actually, a few faster ways).

The least faster, but most straightforward way, is (AIR CODE):

  Open "c:\NeededFile.csv" For Binary As #1

  Buf$ = String$(LOF(1), 0)
  Get 1,,Buf$
  Buf$ = Replace$(Buf$, vbLf, vbCr) ' NOT vbCrLf
  Put 1,1,Buf$
  Close #1

This works because while VB won't deal with files having only a LF
delimiter, it does just fine with only a CR delimiter (VB essentially
ignores LFs). It's faster because the string (and the file) doesn't
need to expand.

More speed if you avoid strings (and Unicode):

  Dim Idx As Long
  Dim Buf() As Byte

  Open "c:\NeededFile.csv" For Binary As #1


  Idx = LOF(0)
  ReDim Buf(1 To Idx) As Byte
  Get 1,,Buf()
  For Idx = 1 To Idx
    If Buf(Idx) = 10 Then
      Buf(Idx) = 13
    End If
  Next
  Put 1,1,Buf()
  Close #1

Of course any method, including the one you propose, should only be
used if you know that the file contains only LF delimiters.

-- 
   Jim Mack
   Twisted tees at http://www.cafepress.com/2050inc
   "We sew confusion"

0
Jim
6/7/2010 7:44:47 PM
"Henning" <computer_hero@coldmail.com> wrote:

>Just read here or there that someone deliberately saved files in that 
>format. For me it's a big why?? to save some CR's? Or is it to ease for 
>mac'ers to read the files?

The CRLF format is peculiar to DOS and Windows.  In the rest of the world it's 
just CR.  

0
sfdavidkaye2
6/7/2010 8:01:30 PM
sfdavidkaye2@yahoo.com (David Kaye) wrote:

>The CRLF format is peculiar to DOS and Windows.  In the rest of the world it's 
>just CR.  

I got it backwards.  It's LF.  

0
sfdavidkaye2
6/7/2010 8:02:49 PM
David Kaye wrote:
> "Henning" <computer_hero@coldmail.com> wrote:
> 
>> Just read here or there that someone deliberately saved files in that 
>> format. For me it's a big why?? to save some CR's? Or is it to ease for 
>> mac'ers to read the files?
> 
> The CRLF format is peculiar to DOS and Windows. In the rest of the
> world it's just CR.
> 

For suitable definitions of "rest" and time frame, anyway... :)

DEC RT-11 was at least one crlf that I recall.

CDC NOS used double 6-bit 0's (after 60-bit words).

Many other things that now seem oddities... :)

--
0
dpb
6/7/2010 8:30:01 PM
"David Kaye" <sfdavidkaye2@yahoo.com> wrote in message 
news:hujj6n$ac1$2@news.eternal-september.org...

>>Just read here or there that someone deliberately saved files in that
>>format. For me it's a big why?? to save some CR's? Or is it to ease for
>>mac'ers to read the files?
>
> The CRLF format is peculiar to DOS and Windows.

In the sense of they're the only surviving major OSes that use that 
convention. They certainly didn't invent it just to be different; they 
inherited it from their predecessors.

> In the rest of the world it's just CR.

You've already corrected yourself on that one, but realize that "the rest of 
the world" isn't as big as it might sound when you consider just how much of 
the world is DOS and Windows! 


0
Jeff
6/7/2010 10:13:27 PM
On 07/06/2010 21:01, David Kaye wrote:
> "Henning"<computer_hero@coldmail.com>  wrote:
>
>> Just read here or there that someone deliberately saved files in that
>> format. For me it's a big why?? to save some CR's? Or is it to ease for
>> mac'ers to read the files?
>
> The CRLF format is peculiar to DOS and Windows.  In the rest of the world it's
> just CR.

Erm, the vast majority of (text based) network protocols specify a CRLF 
line ending.
SMTP, POP, IMAP, HTTP (and derivatives), NNTP, Email content, etc. all 
use CRLF.

-- 
Dee Earley (dee.earley@icode.co.uk)
i-Catcher Development Team

iCode Systems

(Replies direct to my email address will be ignored.
Please reply to the group.)
0
Dee
6/8/2010 8:21:20 AM
"Jeff Johnson" <i.get@enough.spam> wrote in message 
news:hujqu9$v41$1@news.eternal-september.org...
> "David Kaye" <sfdavidkaye2@yahoo.com> wrote in message
>> The CRLF format is peculiar to DOS and Windows.
>
> In the sense of they're the only surviving major OSes that use
> that convention. They certainly didn't invent it just to be
> different; they inherited it from their predecessors.

.. . . who themselves inherited it from the old fashioned manual typewriter, 
although in the case of the manual typewriter it was LF followed by CR.

Mike




0
Mike
6/8/2010 8:54:26 AM
"Mike Williams" <Mike@WhiskeyAndCoke.com> schrieb im Newsbeitrag 
news:O$rSzguBLHA.980@TK2MSFTNGP04.phx.gbl...
> "Jeff Johnson" <i.get@enough.spam> wrote in message 
> news:hujqu9$v41$1@news.eternal-september.org...
>> "David Kaye" <sfdavidkaye2@yahoo.com> wrote in message
>>> The CRLF format is peculiar to DOS and Windows.
>>
>> In the sense of they're the only surviving major OSes that use
>> that convention. They certainly didn't invent it just to be
>> different; they inherited it from their predecessors.
>
> . . . who themselves inherited it from the old fashioned manual typewriter, 
> although in the case of the manual typewriter it was LF followed by CR.
>
> Mike
>


Mike,

I can't remember the sequence my old manual typewriter performed the tasks,
it  probably differed from manufacturer to manufacturer, and I never used an
electrical typewriter. I however used/programmed a typewriter in the
mid-seventies and while you could first punch  LF followed by CR it was
*not* advisable to do so. The first character on the new line wouldn't be in
the leftmost position due to the latency time of the mechanical equipment.
In other words, the next character was printed while the print head was still
moving to the left side.
They had deliberately shortened the delay after a CR to increase overall
print speed. If you used CR-LF this didn't matter, the line feed could
happen while the print head was still moving.

Helmut. 

0
Helmut
6/8/2010 11:34:05 AM
"Helmut Meukel" <Helmut_Meukel@NoProvider.de> wrote in message 
news:hul9re$4o7$1@news.eternal-september.org...

> Mike, I can't remember the sequence my old manual
> typewriter performed the tasks, it  probably differed
> from manufacturer to manufacturer

As far as I recall it was the same for every manufacturer, and with good 
reason. Both the line feed (the rotation of the roller around which the 
paper was fed) and the carriage return (the actual sliding of the entire 
carriage from left to right) were performed with just one lever. The user 
moved the lever and the first part of the lever movement caused the 
mechanism to first rotate the roller (line feed) and whilst it was doing 
that it did not meet with sufficent mechanical resistance to actually begin 
to move the carriage along. It was only after it has rotated the roller by 
the equivalent of one line (using the first small amount of the user's lever 
movement) that the lever came up against the mechanical roller stop, and the 
rest of the user's continued movement of the lever then caused to carriage 
to move along. This enabled the user to perform both a line feed and a 
carriage return (an often required action) with one single movement of the 
lever, and it also allowed the user to perform just a line feed without a 
carriage return (another often required action) simply by moving the same 
lever just a short amount, without continuing to move it once the "begin to 
move the carriage" resistance was felt (for line spacing between paragraphs 
etc and whenever else it was required to position the next line a number of 
lines below the preceeding one).

> I however used/programmed a typewriter in the
> mid-seventies and while you could first punch  LF
> followed by CR it was *not* advisable to do so.
> The first character on the new line wouldn't be in
> the leftmost position due to the latency time of the
> mechanical equipment.

Ah, but that's not what I would call a manual typewriter. It's one of those 
new fangled beasts with the fancy electric motors! And of course it 
certainly does not pre-date the manual typewriters that I am talking about 
;-)

Mike




0
Mike
6/8/2010 12:22:09 PM
On Tue, 8 Jun 2010 09:54:26 +0100, "Mike Williams"
<Mike@WhiskeyAndCoke.com> wrote:

>"Jeff Johnson" <i.get@enough.spam> wrote in message 
>news:hujqu9$v41$1@news.eternal-september.org...
>> "David Kaye" <sfdavidkaye2@yahoo.com> wrote in message
>>> The CRLF format is peculiar to DOS and Windows.
>>
>> In the sense of they're the only surviving major OSes that use
>> that convention. They certainly didn't invent it just to be
>> different; they inherited it from their predecessors.
>
>. . . who themselves inherited it from the old fashioned manual typewriter, 
>although in the case of the manual typewriter it was LF followed by CR.
>

It will perhaps make more sense if you appreciate that 'Line Printing"
came from Telegraphy/Teletype devices, not 'manual typewriters'.

Various conventions came about to abstract the notion of a "New Line".
Many of these conventions overloaded a specific value in order to save
clicks/space. So whenever one takes a closer look they have to
consider the context under which a "NewLine" is defined or expected.

For example, the reason Lf/Cr may occasionally fail under a particular
scheme - is because it is not recognized as a "NewLine" while Cr/Lf is
- even though literal control defined by each in whatever order
produces the same result.
0
ralph
6/8/2010 8:51:09 PM
On Jun 8, 7:22=A0am, "Mike Williams" <M...@WhiskeyAndCoke.com> wrote:
> "Helmut Meukel" <Helmut_Meu...@NoProvider.de> wrote in message
>
>
> > I however used/programmed a typewriter in the
> > mid-seventies and while you could first punch =A0LF
> > followed by CR it was *not* advisable to do so.
> > The first character on the new line wouldn't be in
> > the leftmost position due to the latency time of the
> > mechanical equipment.
>
> Ah, but that's not what I would call a manual typewriter. It's one of tho=
se
> new fangled beasts with the fancy electric motors! And of course it
> certainly does not pre-date the manual typewriters that I am talking abou=
t
> ;-)
>
> Mike

You're probably referring to a good old-fashioned Underwood
typewriter!  I used to use one of those!  Young kids these days and
their new-fangled electricity!

Chris
0
Chris
6/8/2010 9:18:05 PM
"ralph" <nt_consulting64@yahoo.net> wrote in message 
news:4n6t061c8sgjaesugfq6leh52gft2l26ch@4ax.com...
> On Tue, 8 Jun 2010 09:54:26 +0100, "Mike Williams"
> <Mike@WhiskeyAndCoke.com> wrote:
>>although in the case of the manual typewriter
>> it was LF followed by CR.
>
> It will perhaps make more sense if you appreciate that
> 'Line Printing" came from Telegraphy/Teletype devices,
> not 'manual typewriters'.

What do you mean by, "it will perhaps make more sense"? It already makes 
sense to me. Always has done. As I stated, and as you can see in the above 
extract, "in the case of the manual typewriter it was LF followed by CR".  I 
don't care where the phrase "Line Printing" came from (although I do know 
where it came from). I never mentioned that phrase since it was not relevant 
to what I was saying. I simply stated the truth, and that is the fact that 
on the old fashioned manual typewriter it was almost universally "line feed 
before carriage return". There have been a few "odd ball" machines, but in 
general the operator of almost all manual typewriters typed characters one 
by one and as she did so the carriage slowly moved to the left, until the 
desired end of the line was reached. Then the operator almost invariably 
performed a "line feed" to roll the paper down to the next line, followed by 
a carriage return to return the carriage back to the right side of the 
machine in order to start typing the next line, and those two operations 
were carried out in that specific order by the same one lever movement. And 
of course old fashioned manual typewriters, which as I have said almost 
invariably used line feed followed by carriage return, long predated your 
telegraphy and teletype / teleprinter device (which, incidentally, we had 
great fun with many years ago when I was in the Army, sending images of the 
Queen and other unsavoury characters as Ascii :-)

Mike





0
Mike
6/9/2010 4:21:34 PM
Reply:

Similar Artilces:

Exponential trend-line equation problem
Hello, I have made a exponential graph of below data set: x y 0,90498 14294225 0,88252 14361091 0,91054 14392452 0,89546 14463203 0,90225 14535720 0,93918 14754041 0,93624 14812708 0,92533 14922256 0,94256 15000374 0,94681 15049871 0,93819 15051332 0,93495 15188711 0,95299 15425517 The equation I get is: y = 6E+06e0,950x Microsoft (http://office.microsoft.com/en-us/excel-help/add-change-or- remove-a-trendline-in-a-chart-HP010007461.aspx) states that the exponential equation is written on this form: y = c*e^b*x where c and b are constants and e is the base of the ...

Shade under a line
I have scatterplots with date/time along the X axis, and data on the Y axis. I'd like to add shading from sunrise to sunset. I can create a line on the scatterplot that is 0 during the day and a value greater than the max Y value at night, but would like to be able to shade under this line to more easily visualize when it's dark. I also tried creating a bar graph in the background on a second X axis, thinking I could have small categories with date and light/dark data, but the time axis cannot do increments smaller than days, so that hasn't worked. Any suggestions? I ha...

Public Folder Store Present on Front-Ends
I ran the EXbpa and it said that it is recommended to dismount the Public folders stores on my front end severs. When I dismounted them mail started queueing up and did not start again until I mounted the stores. Why would this be when Microsoft recommends it and what does the PF store have to do with mail flow? I am running Exchange Server 2003 SP2 Tyson <Tyson@discussions.microsoft.com> wrote: >I ran the EXbpa and it said that it is recommended to dismount the Public >folders stores on my front end severs. When I dismounted them mail started >queueing up and did no...

VBA code to say Yes or No if any VBA code is present in ActiveWork
Using XL 2003 & 97 Would like hit Ctrl+Shift+V and have an answer either yes or no as to the presence of Any VBA code in the Active Workbook. I do know that about the VBA editor/Explorer or to press the Run Macro button and get a list from various sources . I would like to stay at the keyboard and process a series of macros including one to let me know if I even need to evoke the VBA explorer. TIA Dennis There is no bootstrap macro to tell you whether you have macros or not. If there were there would be no limit to virus writers. --- HTH, David McRitchie, Microsoft MVP - Excel ...

Let me use the Line Color icon on charts
It would speed up a lot of my work if I could use the Line Color icon on Excel charts, the same way I am able to use the Fill Color and Font Color icons. However, when I highlight any chart object, like the Plot Area, Chart Area, or a Series, the Line Color icon is disabled. -- Stuart Bratesman, Jr., MPP Muskie School of Public Service Univ. of Southern Maine Portland, Maine ---------------- This post is a suggestion for Microsoft, and Microsoft responds to the suggestions with the most votes. To vote for this suggestion, click the "I Agree" button in the message pane. If ...

A Newbie question. Input value and have return inserted in Word
I have a listing of numbers with names/addresses in Excel and would like to be able to enter a number and have the corresponding info returned into a Word merge file. Is this possible? Any help would be greatly appreciated. Tks ------------------------------------------------ ~~ Message posted from http://www.ExcelTip.com/ ~~ View and post usenet messages directly from http://www.ExcelForum.com/ ...

FRx lines
Anyone know how to have a financial line that references a category number & then subtracts out a "full" GL number? Seem FRx doesn't like having the combination of the different types of GL refenences Thanks If you are not using a Tree, then you can put the GL account in the next line of the row format. Create a row that adds the two lines. Then hide the category and the account rows. "Merle" wrote: > Anyone know how to have a financial line that references a category number & > then subtracts out a "full" GL number? Seem F...

Stopping word split lines over pages
Hi All, I wonder whether you knowledgeable folk can help me... I'm really stuck with this one and it's driving me slightly crazy. I'm re-typing/ editing a theatre script in word. It's formatted so that the Character's name who is speaking is on one line and then directly below is there dialogue. There is then 2 line breaks before the next section of dialogue... E.g: SAM Hello There how are you? JOHN I'm fine thanks... How was your day? SAM Good... (etc. etc.) What I want to stop work from doing is splitting the Character's name and the li...

Use VBA to update Access table or Query from Excel
Can I use VBA to update Access table or Query from Excel? Thanks in advance Hi Leungkong, > Can I use VBA to update Access table or Query from Excel? Of course, using ADO or DAO. See: http://www.erlandsendata.no/english/index.php?d=envbadacexportado Regards, Jan Karel Pieterse Excel MVP http://www.jkp-ads.com Hi Jan, Thanks. I think ADO is what I want. But I am not only want to export from excel to access. I want to edit some data in access table. For example, Access has a table "ProductList" I want to use Excel to call the product by "Pro...

Rotate Time Line dates
Hi, This is my last question (for the time being). How to rotate the dates on a time line bar by 90 degrees (left or right)? In my attempts, the dates are unreadable because they overlap. I will overlook the proper command. -- Mvg, Frans ...

Print, Merged Cells, and VBA
Hello I'm looking for a code that will help me with a print job for a worksheet. There are a lot of merged cells and a lot of "IF"s to be used in the VBA for range selection. Thanks in advance, Sarr ...

VBA and Scheduled task in Outlook
Hi, how can I: a) pull the query from somewhere and send it by e-mail automatically. E.g. I want to take a temperature table from http://www.wunderground.com/history/airport/EHAM/2009/7/10/DailyHistory.html?req_city=NA&req_state=NA&req_statename=NA where 2009/7/10 is the date of yesterday put it into an e-mail and send it automatically each day at 8 o'clock? b) if this is not possible, how can I send an e-mail with the attachment c:\Documents\query20090710.xls each day at 8 o'clock? my boss wants this automatized, I know how to write the VBA code for Excel, but don'...

vba select field
Hi, having a button on a form, is it possible to select only some fields (all from the same table) of the current record instead of all fields? I've tried this code: RunCommand acCmdSelectRecord RunCommand acCmdCopy Forse dipende dei dati nel record. but it selects ALL fields in the form. Thank you. Remigio hi, On 10.04.2010 18:01, remigio wrote: > having a button on a form, is it possible to select only some fields > (all from the same table) of the current record instead of all fields? > I've tried this code: > > RunCommand acCmdSelectRecord &...

VLOOKUP in VBA
On the worksheet I can insert in a cell =VLOOKUP(C5, Hobokee.xls!AcsLow, 2) and it works perfectly, looks up the value in column 2 of the range named AcsLow in the same workbook. But elswhere I want in a macro to lookup the same table and assign the result to a variable BalAmt. BalAmt = VLOOKUP(AccNum, Hobokee.xls!AcsLow, 2) does not work. It gives a function not defined error on Hobokee. If instead of Hobokee I put Workbooks("Hobokee"), it gives function not defined error for VLOOKUP which it changes to VLookup. I have been overVLOOKUP in the Help file and see nothing wrong. W...

Deleting to the end of the document
I want to use VBA to delete everything following my present position in the document to the very end. How is that done? "LA Lawyer" <LALawyer@discussions.microsoft.com> wrote in message news:8C996D3B-846F-419C-A8D4-782FE3721877@microsoft.com... >I want to use VBA to delete everything following my present position in the > document to the very end. > > How is that done? Selection.MoveEnd Unit:=wdStory, Count:=1 Selection.Delete -- Regards Jonathan West ...

Excel VBA/Macro programming for beginners
Hi all, I know a bit VB 6.0 programming. Will it help me to write exce vba/macro(same thing?).can anybody help me by providing some fre websites where i can have informations/codes for VBA/macro. Please tell me how could i make a *command Button * in a cell in th excel sheet -- sdebu_200 ----------------------------------------------------------------------- sdebu_2000's Profile: http://www.officehelp.in/member.php?userid=430 View this thread: http://www.officehelp.in/showthread.php?t=118812 Posted from - http://www.officehelp.i Try David McRitchie's "getting started with mac...

Turn pc speaker on/off with vba code
Is this possible? Thanks I found something here on how to do it withVBScript. You can probably modify it to work in VBA http://www.pcreview.co.uk/forums/thread-1468591.php -- HTH, Barb Reinhardt "David" wrote: > Is this possible? > Thanks Thanks Barb I'll have a go (I need to improve my web searching skills) "Barb Reinhardt" wrote: > I found something here on how to do it withVBScript. You can probably modify > it to work in VBA > > http://www.pcreview.co.uk/forums/thread-1468591.php > -- > HTH, > ...

Loading a Form from VBA
Hi all, I'd like a module to open and load a form in my Access 2003 database... How can I do this? Use the OpenForm method. Look in the Help file for details. -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no e-mails, please!) "Mike" <michael.leon.schwartz@gmail.com> wrote in message news:1184770076.109526.207900@o11g2000prd.googlegroups.com... > Hi all, I'd like a module to open and load a form in my Access 2003 > database... How can I do this? > On Jul 18, 10:58 am, "Douglas J. Steele" <NOSPAM_djsteele@NOSPAM_canada.com&g...

Auto Fill Series when number ends in -1
I am trying to complete an autofill in excel The numbers are 900000824-1, 90000825-1, 900000826-1 to 900001133-1 I have tried typing 900000824-1 into cell A1, 90000825-1 into cell A2, 900000826-1into cell A3, when I try to fill I get 900000824-2, 90000825-2, 900000826-2 in A4, A5, A6 (respectively). Have tried to creat a custom fill series with no luck either, any assistance will be most appreciated. Thank you. Just in case something like this would work for you..... Put 900000824 in the first cell Change the number format of that cell: Format>Cells>Number tab Category: Custom ...

Excel and VBA
I am very interested in learning more about using VBA in office, especially Excel. Can you post some resources (online, books, etc) that can be used to help learn about using Visual Basic in office. Thanks! Here's a good place to start: http://www.contextures.com/xlbooks.html Does that help? *********** Regards, Ron XL2002, WinXP "Bob Sinclair" wrote: > I am very interested in learning more about using VBA in office, especially > Excel. Can you post some resources (online, books, etc) that can be used to > help learn about using Visual Basic in office. >...

VBA Customization
Is there a way to get the name of the current company through VBA in Great Plains 8.0? Thanks for all your help. open GreatPlains. Add the current window, it will add the Toolbar then add fields choose the company name on the top left after the user id. >-----Original Message----- >Is there a way to get the name of the current company through VBA in Great >Plains 8.0? > >Thanks for all your help. > > > >. > Thanks. I tried, but I couldn't add company name to the field list. It opens up the login screen instead. Any thoughts? Thanks again. "ger...

Can I get Excel to determine the line curve formula without graph.
I am trying to otain a solution for the number where two curves meet. Specifically trying to determine the expected flow rate given a pump curve and system curve. The curves shift depending on variables that are read from a spreadsheet. I can get the curve formulas by graphing them and requesting the trendline feature, but then I have to manually enter the curve formulas, set them equal to each other, and solve the equation. Can Excel do this automatically from two data sets? Any help would be appreciated. Hi, What kind curves are they (i.e., what kind of functions are those trendline ...

Run VBA without show
I want excel to run the VBA code without showing me what it is doing. Which code should i use for that? Sub RunWithoutShow() Application.ScreenUpdating = False 'Paste the vba code here 'end of code 'Change screenupdating property to true Application.ScreenUpdating = True End Sub I hope this helps... Selva V Pasupathy For more on Excel, VBA, & other Resources Please visit: http://socko.wordpress.com You may also (inserting into quote from code example bellow from Socko) Use Application.Visible property to hide the application entirely Sub RunWithoutShow() Appli...

Form Controls vs VBA controls
I am new to VBA so just finding my feet, can anyone help me with th differences between an excel control (i.e. one from the form toolbox lets say a checkBox and a vba checkBox? From trying the two controls the I have noticed is that you canno capture the change event of the VBA checkbox in the code module, it ha to be done via the sheet (i.e. checkbox on sheet1, code goes in chang event on sheet1) the control is placed on, is this correct? What woul you do if you have three sheets with the same controls just differen data, do you really have to code the control 3 times? The excel control ho...

Referencing a ComboBox in VBA
Hi, I am using Excel 2007. I want to run some code in my Workbook_Open() Sub that fills a combo box on one of my Worksheets (I will call it myCombo on mySheet). I tried the following code and it did not work: myCombo.Clear myCombo.AddItem "Item One" myCombo.AddItem "Item Two" myCombo.AddItem "Item Three" I assume that the problem is that within the Workbook_Open() Sub, the reference to myCombo is not valid. Can anyone tell me if/how I can get a valid reference to myCombo (on mySheet)? Thanks in advance, Paul Kraemer -- Paul Krae...