Re: update same row

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Bart Cuenen (BartCuenen_at_discussions.microsoft.com)
Date: 11/13/04

  • Next message: Craig: "Changing Folder To Offline"
    Date: Sat, 13 Nov 2004 11:24:01 -0800
    
    

    Here is the full code.
    I don't find any problem in it. Once again, I don't know anything about vb
    or vba..
    All the scripts I use are created for 90% by somebody else and I adjusted
    them to my needs with the help of you and some orthers.
    Danke Michael!

    "Michael Bauer" wrote:

    > Please execute your code step by step (F8) and check, if rn somewhere is
    > nothing or, if not, to which address it refers.
    >
    >
    > --
    > Viele Grüße
    > Michael Bauer
    >
    >
    > "Bart Cuenen" <BartCuenen@discussions.microsoft.com> wrote in message
    > news:AC7A65C2-A9A0-4016-8B64-814BDF165D85@microsoft.com...
    > > the problem is somewhere with the offset it seems.
    > > For example:
    > > I have in cell A2: benjamin
    > > I have in cell B2: 12/11/2004
    > >
    > > When I run the script and the inputname is benjamin then it should add
    > the
    > > current date to C2 and it's not doing that
    > >
    > > The farest I'm getting it is that it will put the date in the first
    > empty
    > > cell 1 row higher then strmyinput.
    > > In my case, I enter benjamin and the date appears in cell C1, not even
    > in B1
    > > if that cell is empty.
    > > Set rn = ws.Columns(1).Find(strmyinput, , xlValues, xlWhole, xlByRows,
    > > xlPrevious)
    > > If Not rn Is Nothing Then
    > > Set rn = rn.Rows.Find("*", , xlValues, xlWhole, xlByRows,
    > xlPrevious)
    > > Set rn = rn.Offset(, xlNext)
    > >
    > > rn.FormulaR1C1 = "=TODAY()"
    > > something is really wrong here...
    > > Thank you for your help Michael!
    > >
    > > "Michael Bauer" wrote:
    > >
    > > > Do you have some more informations? Do you get an error, where is
    > the
    > > > line that doesn´t work?
    > > >
    > > > --
    > > > Viele Grüße
    > > > Michael Bauer
    > > >
    > > >
    > > > "Bart Cuenen" <BartCuenen@discussions.microsoft.com> wrote in
    > message
    > > > news:411B1CF1-3E72-4E2B-9092-8E795E66A3BD@microsoft.com...
    > > > > somehow it doesn't keep updating the cell...
    > > > > idea?
    > > > >
    > > > > "Bart Cuenen" wrote:
    > > > >
    > > > > > Gents,
    > > > > > I'm currently using a script that opens excel and adds a line to
    > the
    > > > first
    > > > > > empty cell.
    > > > > > How can I expand this to : if the name (strmyinput) is already
    > on
    > > > that list,
    > > > > > add it to the same row on a new column instead of on a new row?
    > > > > > here's the script I got:
    > > > > > Sub bootstart()
    > > > > > strmyinput = InputBox("recruitname?")
    > > > > > Set oExcel = CreateObject("Excel.Application")
    > > > > > oExcel.Visible = True
    > > > > > Set oWbks = oExcel.Workbooks
    > > > > > Dim ws As Excel.Worksheet
    > > > > > Dim wb As Excel.Workbook
    > > > > > Dim rn As Excel.Range
    > > > > > Set wb = oWbks.Open("C:\Documents and Settings\Overlord\My
    > > > > > Documents\Bart\TEAMSPEAK.xls")
    > > > > > Set ws = wb.Worksheets("Recruits")
    > > > > > Set rn = ws.Columns(1).Find("*", , xlValues, xlWhole, xlByRows,
    > > > xlPrevious)
    > > > > > If Not rn Is Nothing Then
    > > > > > Set rn = rn.Offset(1, 0)
    > > > > > rn.Value = strmyinput
    > > > > > Set rn = rn.Offset(0, 1)
    > > > > > rn.FormulaR1C1 = "=TODAY()"
    > > > > > Else
    > > > > > ' the last row (65536) isn´t empty
    > > > > > End If
    > > > > > wb.Save
    > > > > > wb.Close
    > > > > > Excel.Application.Quit
    > > > > > End Sub
    > > > > >
    > > > > > I tried with Set rn = ws.Columns(1).Find("*" or strmyinput, ,
    > > > xlValues,
    > > > > > xlWhole, xlByRows, xlPrevious) but that didn't work.
    > > > > > any ideas anyone?
    > > > > > Thx!
    > > > > > --
    > > > > > Welcome back, Bart Cuenen. If you're not Bart Cuenen, sign out
    > by
    > > > clicking
    > > > > > the Sign Out button above, and then sign in again. LMAO!
    > > >
    > > >
    >
    >


  • Next message: Craig: "Changing Folder To Offline"

    Relevant Pages

    • Re: Merging Tables
      ... OK - try going to the first row of a table that starts on something other ... indicate a bunch of empty paragraphs separating the ... It is very common for these scripts to have a lot of half used ... (Show/Hide ¶ doesn¹t reveal any hard break) ...
      (microsoft.public.mac.office.word)
    • Re: Security Update MS06-015 - Fix
      ... trust it implicitly. ... It didn't help with some 'dipstick' mentioning a 'file being empty' ... A confirmation? ... Are you asking whether it's safe to use Kelly's scripts?. ...
      (microsoft.public.windowsxp.general)
    • Re: [opensuse] disk filled up by /tmp/kde-user/kconf_update*
      ... configuration needs updating due to a new software version. ... can install scripts that modify its existing config files. ... Otherwise it could be hard to track down the app that is causing the ... empty, so we will have to detect it indirectly. ...
      (SuSE)
    • Re: rmdir permission errors on a Windows box
      ... >> have anywhere else to test my scripts), ... >> folders, which completely mystifys me. ... Yes the directories are empty, what this part of my script does is ... All the files get removed but even the most bottom level directories ...
      (comp.lang.php)
    • Re: How to suppress warning messages for empty lines in shell scripts?
      ... empty lines ... How can I suppress this warning? ... Do I really have to always avoid empty lines in shell scripts? ...
      (comp.os.linux.misc)