Error Checking in Excel
Thanks Thanks:  0
Likes Likes:  0
Results 1 to 3 of 3

Thread: Inserting text to a cell

  1. #1
    Board Regular
    Join Date
    Feb 2002
    Posts
    117
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Hi-
    Im using the following code to insert text into a cell 10 columns to the right of the date cell.

    Sheets ("balance sheet").select
    Range("d5").Select
    While ActiveCell.Value <> Int(Now)
    ActiveCell.Offset(1, 0).Select
    Wend
    ActiveCell.Offset(0, 10).Value = TextBox1.Text
    End With

    The problem is that I do not want to show the "balance sheet" when this command takes place. How do I write or fix this code so that when I press the commandbutton on the userform, the code lists textbox1.text , but does not show me the "balance sheet"?
    thanks!


  2. #2
    MrExcel MVP
    Join Date
    Feb 2002
    Location
    Sunny, spring-like Hull
    Posts
    3,339
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    You could try something like this (I commented out the 'End With' piece of your code as I'm not sure why it's there): -

    Dim SheetName As String

    SheetName = ActiveSheet.Name
    Application.ScreenUpdating = False

    Sheets("balance sheet").Select
    Range("d5").Select
    While ActiveCell.Value <> Int(Now)
    ActiveCell.Offset(1, 0).Select
    Wend
    ActiveCell.Offset(0, 10).Value = TextBox1.Text
    'End With

    Sheets("" & SheetName & "").Select
    Application.ScreenUpdating = True


    [ This Message was edited by: Mudface on 2002-03-04 08:24 ]

  3. #3
    Board Regular
    Join Date
    Feb 2002
    Posts
    117
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Thanks, it worked

Some videos you may like

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •