Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Inserting data into a different worksheet


Hello, I have a VBA form that a user completes to add data. When the
form is closed, I can transfer the data into the current worksheet by
this....


Code:
--------------------

Range("h" & TankLine).Value = txtDate.Text
Range("i" & TankLine).Value = txtTime.Text
Range("g" & TankLine).Value = txtInits.Text

--------------------


but I can't get it to put data into a different worksheet in the same
workbook. I have tried


Code:
--------------------

Sheet1.Range("h" & TankLine).Value = txtDate.Text

--------------------


and


Code:
--------------------

Sheet1!Range("h" & TankLine).Value = txtDate.Text

--------------------


but neither works.

How do I do this, please?

Thanks,
Richard


--
rickalty
------------------------------------------------------------------------
rickalty's Profile: http://www.excelforum.com/member.php...o&userid=34180
View this thread: http://www.excelforum.com/showthread...hreadid=539426

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Inserting data into a different worksheet

Try

Worksheets("Sheet2").Range("h"&TankLine).Value = txtDate.Text


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"rickalty"
wrote in
message
...

Hello, I have a VBA form that a user completes to add data.
When the
form is closed, I can transfer the data into the current
worksheet by
this....


Code:
--------------------

Range("h" & TankLine).Value = txtDate.Text
Range("i" & TankLine).Value = txtTime.Text
Range("g" & TankLine).Value = txtInits.Text

--------------------


but I can't get it to put data into a different worksheet in
the same
workbook. I have tried


Code:
--------------------

Sheet1.Range("h" & TankLine).Value = txtDate.Text

--------------------


and


Code:
--------------------

Sheet1!Range("h" & TankLine).Value = txtDate.Text

--------------------


but neither works.

How do I do this, please?

Thanks,
Richard


--
rickalty
------------------------------------------------------------------------
rickalty's Profile:
http://www.excelforum.com/member.php...o&userid=34180
View this thread:
http://www.excelforum.com/showthread...hreadid=539426



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Inserting data into a different worksheet


Thank you! That worked perfectly.

Richard


--
rickalty
------------------------------------------------------------------------
rickalty's Profile: http://www.excelforum.com/member.php...o&userid=34180
View this thread: http://www.excelforum.com/showthread...hreadid=539426

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
inserting a worksheet ysam4440 Excel Discussion (Misc queries) 6 April 8th 10 04:07 AM
Inserting data from one worksheet to another jmholt Excel Worksheet Functions 1 July 9th 09 12:45 PM
Inserting New Worksheet Problems with formula within worksheet Excel Discussion (Misc queries) 0 November 29th 06 04:47 PM
Inserting row in 1 worksheet and updating a different row in another worksheet [email protected] Excel Discussion (Misc queries) 0 August 9th 06 09:13 PM
Macro's - inserting a worksheet and having upload data Can't work it out Excel Programming 2 January 24th 05 04:47 AM


All times are GMT +1. The time now is 08:52 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"