Still problems with userform

Hi!
I use the following code but I get an error(424) Object required and I can�t
figure it out. Please help!! Error line marked with *

Option Explicit
Private Sub CommandButton1_Click()
   Dim LastRow As Range
   Dim response As Long

  * Set LastRow = Sheet1.Range("a65536").End(xlUp)
   LastRow.Offset(1, 0).Value = TextBox1.Text
   LastRow.Offset(1, 1).Value = TextBox2.Text
   LastRow.Offset(1, 2).Value = TextBox3.Text

   MsgBox "One record written to Sheet1"
   response = MsgBox("Do you want to enter another record?", _
      vbYesNo)
   If response = vbYes Then
      TextBox1.Text = ""
      TextBox2.Text = ""
      TextBox3.Text = ""
      TextBox1.SetFocus
   Else
      Unload Me
   End If
End Sub


Many thanks in advance!!
Marcus


0
9/19/2004 8:10:51 AM
excel 39879 articles. 2 followers. Follow

1 Replies
562 Views

Similar Articles

[PageSpeed] 26

Hej Marcus

You're in Sweden ? My guess is that your Excel doesn't codename the sheets
Sheet1, Sheet2, ... .Your direct adressing coding style requires the sheet
object name that's displayed in the VBE's project explorer, not what the
sheet tabs contain.

Try replacing "Sheet1" with "Ark1" or whatever it says in swedish, or change
to one of these styles

Sheets(1).Range("a65536").End(xlUp)
will use the first sheet in the workbook, no matter what it's named. Will
err if it's a chart sheet.

Sheets("Sheet1").Range("a65536").End(xlUp)
will use the one with the sheet tab saying "Sheet1", no matter where it's
placed. Will err if no such name exists.

HTH. Best wishes Harald


"Marcus Peders�n" <marcus.pedersen@swipnet.se> skrev i melding
news:_5b3d.6137$LV3.8260@nntpserver.swip.net...
> Hi!
> I use the following code but I get an error(424) Object required and I
can�t
> figure it out. Please help!! Error line marked with *
>
> Option Explicit
> Private Sub CommandButton1_Click()
>    Dim LastRow As Range
>    Dim response As Long
>
>   * Set LastRow = Sheet1.Range("a65536").End(xlUp)
>    LastRow.Offset(1, 0).Value = TextBox1.Text
>    LastRow.Offset(1, 1).Value = TextBox2.Text
>    LastRow.Offset(1, 2).Value = TextBox3.Text
>
>    MsgBox "One record written to Sheet1"
>    response = MsgBox("Do you want to enter another record?", _
>       vbYesNo)
>    If response = vbYes Then
>       TextBox1.Text = ""
>       TextBox2.Text = ""
>       TextBox3.Text = ""
>       TextBox1.SetFocus
>    Else
>       Unload Me
>    End If
> End Sub
>
>
> Many thanks in advance!!
> Marcus
>
>


0
innocent (844)
9/19/2004 9:52:47 AM
Reply:

Similar Artilces:

Windows 7 AD problem
Frustrating issue here: I have a windows server 2003 AD infrastructure. I Windows 7 as my company computers. I have 1 user (user A) that, when logged into the network, loses control of his screen when user B starts typing. I have made sure that IPs are not conflicting. I have created different accounts for both of them but still keep having the same bad luck. It is causing user A to not be able to work because whenever user B is typing an e-mail it literally takes control of user A's screen and starts typing into whatever program he has open. I have never seen nor ...

Outlook still hanging
I have followed the advice from my last message - I have renamed the file to outcmd.old and I have disabled messenger in the Options. The problem only occurs when I try to send/receive. If I turn off send/receive every thing is OK but as soon as I try to manually receive or on opening, Outlook freezes still. please help Peter ...

How to set CEdit to ReadOnly but the background color still White?
I use Visual C++ MFC 4.2. I want to set all my CEdit controls to read only but I want to keep the WHITE BACKGROUND appearance. How to do that? Thank you very much. Handle WM_CTLCOLORSTATIC. -- Ajay "Landon" <Landon@discussions.microsoft.com> wrote in message news:3C081A07-E979-42C5-B56B-8F151B440757@microsoft.com... >I use Visual C++ MFC 4.2. > > I want to set all my CEdit controls to read only but I want to keep the > WHITE BACKGROUND appearance. > > How to do that? > > Thank you very much. I've tried it and it works. But I've got 2 M...

COUNTIF Problem #2
I have a large spreadsheet (20+ columns and 2000+ rows) called 'big_list'. On another spreadsheet, I use the following equation to display the number of times the word 'Open' appears in column H. =COUNTIF('C:\Spreadsheets\[big_list.xls]Sheet1'!$H$1:$H$1676,"Open") Column B of 'big_list' contains dates. What equation would display the number of times the word 'Open' appears in column H and have a date in column B that is earlier than '25/10/03'. Any suggestions? COUNTIF only seems to allow for one variable. Thanks in advance. try ...

Mouse flicker problems in MS Word, ,running windows 7.
I recently installed MS Office Home and Student on a windows 7 operating pc - but everytime I start word my curser flickers in the screen area and i can't click right or left. I don't know what to do to fix this problem. Any ideas would be appreciated. It isn't a Word problem, but my suspicion is either the printer driver is corrupt or incompatible or missing. Make sure that you have the latest driver for your printer and then delete and reinstall the printer. -- Terry Farrell - MSWord MVP "PR100" <PR100@discussions.microsoft.com> wrote in messag...

RAID 10 still best for DB's?
We run Exchange 2003 Enterprise. We have 3 Mailbox stores which had 1-2 databases in each and each maiailbox store in on a RAID 10 partition. We use to have them on RAID 5 at it was very slow sometimes, our average writes/reads to disk per second were sometimes hitting > 50 msecs. Now on RAID 10 we sometimes get the odd >30 msecs but many when backups are running. We are going to be upgrading our server soon, would RAID 10 be the best way? Plus we will eventually upgrade this new server to Exchange 2007. On Fri, 13 Apr 2007 08:00:11 +0100, "Gonzo" <no@no.com> ...

problem when transferring out serialized item
we have a serialized item that was returned by a customer, and was placed into offline inventory. i went to offline inventory and transferred the item out, we did a standard transfer type (we are sending the item back to the supplier). after doing that, i went to the transfer out order, and selected issue all, and tried to commit to it. i get the error message "the following serial number exists in the database, and is not available for issuing: 04215494019" i checked this serial number in the serial table, and the status of the serial number is set at 3. we've never...

Problems with send to
Hello, we have the following problem. There is a worddocument published at our intranet. When i open this document an choose then 'send to', Outlook is starting and a new mail is created with a doc- file attached. But there are some users, if they open this document an choose 'send to', they create a new mail with a attached html-file (doc.htm) Where can i change this behavior.I want always send a doc- file. We are using Outlook2000 with Microsoft-Rich-Text as Emaileditor. The behavior is independent from the IE-version. All help is welcome Thank you Henrik I ca...

Still losing pictures
I am still losing my graphics! Here is what has happened: Originally, I started to edit an existing file. Most of the pictures were already there. I added some pictures and text using the insert picture from file method. After saving and re-opening the next day, I had lost all of the old images but still had the ones that I had just added. I replaced all of those pictures using the graphics Manager by clicking on the empty picture in the Graphics Manager and selecting replace picture. After saving and re-opening the next day, now they are all gone. I am using windows metafile images. Today,...

Contacts problem after running ADC?
We have a 2000 domain sp4, and a 5.5 sp4 machine on a 2000 server sp 4. We are getting ready to set up 2003 exchange and on a 2003 server and then migrate the mailboxes over. We have installed 2003 and then installed the connector on the 2003 machine, but we have not installed 2003 Exchange. I ran Active Directory Connector and now there are 2 problems? 1. On the global directory in Outlook there are 2 entries for every person, one e-mail address and one (what looks like a) custom recipient, how do I get rid of them? 2. Names are not being resolved when you type them in the to: spa...

problem installing a system-wide hook
I am having trouble installing a system-wide hook (WH_CBT) using SetWindowsHookEx. I have build a DLL which contains my hook procedure and I dynamically load this DLL in my calling application, get the hook proc address, and call SetWindowsHookEx with the thread parameter as NULL. However, when I debug, the hook proc only gets called when windows are created, deactivated, etc for my application, instead I wanted the proc to be called for ANY window creation, activation, etc. I have tried a number of things but I don't understand why I am only able to hook events of my calling application i...

CRM 3 STILL NOT GOOD
Just tried CRM 3 on the demo servers provided by Microsoft. After ALL THE TIME they spent on it . . . and it's STILL NOT AS GOOD AS IT SHOULD BE! It lacks basic functionality found in earlier versions of ACT. And much is not intuitive (such as searching for accounts). I will not enjoy rolling this out to the sales reps as they will say that it's still not good. Even if you add a module like marketing, and yet neglect the basic problems with the software, you still don't have a truly good product. -- Brandon What sort of search functionality were you looking for ?. ...

SP2 problem: Public Folders in OL2003's Favorites
Hi there, Previously with o2k3sp1 running on wxpsp2, in ol2003 cache mode, after adding public folders in Favorites (PF in F), for emails in "PF in F" I can "save as" the email to local harddisk as msg file, after email saved I can delete it from my "PF in F" without affecting the original public folder as the email stil there. However after install o2k3 sp2, for "PF in F" found that I cannot "save as" msg file, prompted "you don't have appropriate permission to perform this operation", I cannot "delete" emails i...

Money 2006 Archiving Problem
I am trying to archive my 2004 checking, saving and credit card transactions. I don’t have any investment accounts set-up which is documented as being a no-go when archiving. If I try to archive all accounts the program makes a backup then goes non-responsive. If I try to archive an individual account the program makes a backup and completes the operation but the archived date is not removed. My current file sizes is 9,000 KB and the program is becoming noticeably slower. Any advise on how to get this data off would be much appreciated. thanks pedro Many of us will not advise peopl...

Problem with calculated fields with data from subform
Hi, We have an application where one of the forms has several calculated fields. Some of the data comes from subforms, some use data in other calculated fields. The subforms are linked to the main form on the invoice number. This has worked for years, moving from Access 95 through 98 to 2000, but one client bought new computers running Win XP Home Edition and with Office XP, and now the calculated fields show up blank.. It appears to be an Access 2003 problem, because it works fine on Access 2000 machines running Win 98, 2000 and XP. I am wondering if it is a timing problem, since some calc...

linking problem
Hello All, Please help i have a linking peoblem, the error i get is : Linking... LIBCD.lib(_wctype.obj) : error LNK2005: _iswupper already defined in TMHotkeys.obj LIBCD.lib(_wctype.obj) : error LNK2005: _iswdigit already defined in TMMDParser.obj LIBCD.lib(_wctype.obj) : warning LNK4006: _iswupper already defined in TMHotkeys.obj; second definition ignored LIBCD.lib(_wctype.obj) : warning LNK4006: _iswdigit already defined in TMMDParser.obj; second definition ignored 10x hy, check for double included files! >-----Original Message----- >Hello All, > >Please help i have a lin...

Outlook 2007 (RTM) New Mail Notification still not fixed?
I've searched the groups and found people experiencing problems with the new mail notification in Outlook 2007. The main problem is that the mail icon in the system tray will only appear when new mail arrives in the DEFAULT store inbox and stays there. If a rule moves the email to a different folder, no mail icon will show up, nor will it show up if email is delivered to an INBOX, but one that is not the default store (i.e. when using an exchange account and a POP account). So....I'm using the final Enterprise version, and the problem still exists. Rules can be created to show the...

repeat question....still looking for an answer
how are people handling the situation of no salesperson ID being transferred over from CRM to Great Plains on the customer card? Also how are people handling the situation of no tax schedule ID available in CRM? I'm told that my customer class ID in GP will have to be set up with a default tax id - THIS DOESN'T MAKE SENSE. Without a salesperson ID or a tax schedule ID it creates a lot more work for my accounting dept. they will have to go into every card in GP and add in the correct tax id and then they have to go to crm to find out who owns the account, go back to GP and ...

Excel Problems #2
My computer: Deskto XP operating syste Office 200 stand alone...not networke I just installed MS Office 2003 and apparently had a user account set up for me during the installation. I am the administrator and I can't get rid of the User accounts....a feature that I do not want. However, when trying to open files I get the following screen message Invalid or missing cookie(s). Your administrator requires that cookies be used to secure your session. Please contact your administrator if you need further assistance. Anyone have any ideas how to handle this problem? I can't get into E...

Archiving problem
Hi, we have a problem with archiving mails from exchange 2000 to outlook pst file on client pc. If I run archive option, it will only create a directory structure of mailbox but do not move any items. If i run archive from pst to another pst, it works fine. Can anyone help me? Jiri Elias <jiri.elias@spika.cz> wrote: > we have a problem with archiving mails from exchange 2000 to outlook > pst file on client pc. > If I run archive option, it will only create a directory structure of > mailbox but do not move any items. If items aren't moved, chances are their modi...

Character Length Problem
Hi ... Can someone help me how i can generate equal length characters in my edit control. By equal length, i mean all characters occupying the same display space, as in DOS, and in contrast to GUI. Ex: Character, 'i' occupies smaller space compared to 'w', in GUI. While i want to have all characters to have the same size. Actually i want to arrange consecutive strings one below the other so that they appear to be arranged in columns. However, i am also consiering the SetTabStops function ... thanks, once again, "PSN" <prakash437@gmail.com> wrote in message ...

Create Lead Problem
I am trying to create a lead using the sample code in the SDK. I cannot get the code to work at all. The code gives the error message "Access is Denied." I also will get the error message "The underlying connection was closed: Unable to connect to the remote server." The line that does not work is "BizUser.WhoAmI()." Does the code have to run on the CRM server? Thanks for any help you can give me. How are you testing the code? Is it from a Windows app or a Web app? If it's from a Windows app, then as long as you are a licensed CRM user, you sh...

Update in progress
When I upgraded to MO5, it duplicated a lot of my accounts. I kinda know why, but that's not the issue. In the Account List, those duplicate accounts indicated they were being updated. But it never goes away and manual updates won't work because another update is already in progress. I'm stuck in an endless, catch 22 loop. I even restarted the software and the updating remained. I deleted all the duplicate accounts, that were supposedly still updating, but there is one left "updating" which is not duplicate. So I can't delete it. How can I get MO5 to st...

Pub 2007 Serious Problem
I've used every Publisher from day one .... with 2007, the print window is slowing me down to no end. It is stupid in that when printing a business card, you have to do a layout each time to tell it where to print the 10 cards, then when you select the quality setting on your printer, and go back, you have to do it all over again. When you want to print 10 sheets you have to select 100 when the cards are to print 10 on a page. 2003 Pub never had this extra window and could print way faster. I'm trying to print 10 pages right now and it is taking about 10 minutes just to load...

CDao problems...
I have an access database (standalone, single user Windows EXE). There are about 20 or so tables in the database and I'm setting up CDaoRecordSet classes to talk to the database - one recordset per table. All tables/recordsets work perfectly except 1. I have a table called "TEreportsettings", which simply fails when I open it (exactly the same was as all other recordsets)... CDAORecordset_ReportSettings recordSet1(dbase); try { recordSet1.Open(dbOpenTable); etc... The open method (in daocore.cpp) runs normally almost to the end, but in the final 'try - catch'...