Inserting text to a cell

Todd_M

Board Regular
Joined
Feb 24, 2002
Messages
117
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!
 

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type
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
 
Upvote 0

Forum statistics

Threads
1,213,554
Messages
6,114,280
Members
448,562
Latest member
Flashbond

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top