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 within a named range..HELP


I'm not an expert in vba in excel, however I would like some help. I
have a worksheet with a named range called "Data". And, also on the
worksheet I have a command button that initiates a userform. On that
userform I have TextBox1.Value and TextBox2.Value...after the OK button
is clicked within the userform, it inserts the data from the userform in
the last row of that named range. I have part of the code to that adds
the data to the worksheet, but the named range area stays the same. How
do I get this to work. This is what I have so far:

Sheets("Sheet1").Range("A65536").End(xlUp)(2, 1).Value = TextBox1.Value

Sheets("Sheet1").Range("A65536").End(xlUp)(1, 2).Value = TextBox2.Value

Sheets("Sheet1").Range("A65536").End(xlUp)(1, 3).Value = TextBox3.Value


Thanks in advance...


--
sulrich
------------------------------------------------------------------------
sulrich's Profile: http://www.excelforum.com/member.php...o&userid=19975
View this thread: http://www.excelforum.com/showthread...hreadid=345553

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Inserting data within a named range..HELP

Sheets("Sheet1").Range("A65536").End(xlUp).Current Region.Name = "Data"

--
Regards,
Tom Ogilvy

"sulrich" wrote in message
...

I'm not an expert in vba in excel, however I would like some help. I
have a worksheet with a named range called "Data". And, also on the
worksheet I have a command button that initiates a userform. On that
userform I have TextBox1.Value and TextBox2.Value...after the OK button
is clicked within the userform, it inserts the data from the userform in
the last row of that named range. I have part of the code to that adds
the data to the worksheet, but the named range area stays the same. How
do I get this to work. This is what I have so far:

Sheets("Sheet1").Range("A65536").End(xlUp)(2, 1).Value = TextBox1.Value

Sheets("Sheet1").Range("A65536").End(xlUp)(1, 2).Value = TextBox2.Value

Sheets("Sheet1").Range("A65536").End(xlUp)(1, 3).Value = TextBox3.Value


Thanks in advance...


--
sulrich
------------------------------------------------------------------------
sulrich's Profile:

http://www.excelforum.com/member.php...o&userid=19975
View this thread: http://www.excelforum.com/showthread...hreadid=345553



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Inserting data within a named range..HELP


Thanks Tom..
One more question....If I have 2 named ranges(let's say "data" an
"data1"), and depending on what the user inputs in TextBox1.Valu
determines on what *named range* the data gets inserted into. Fo
example, if TextBox1.Value = "Blue", information from TextBox1
TextBox2 and TextBox3 will be inserted into the named range "Data".
However, the data is being inserted onto the worksheet, but how do
code it to insert into a specified named range?
The range for Data1 is =Sheet1!$A$1:$E$10 and Data2 i
=Sheet1!$A$12:$E$19.

Thank you inadvance.
:confused

--
sulric
-----------------------------------------------------------------------
sulrich's Profile: http://www.excelforum.com/member.php...fo&userid=1997
View this thread: http://www.excelforum.com/showthread.php?threadid=34555

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
Named Range Graph Data Me Charts and Charting in Excel 1 November 14th 07 05:29 PM
get data from a cell in each named range Shazzer Excel Worksheet Functions 9 December 21st 06 12:11 PM
inserting a named range into new cells based on a named cell Peter S. Excel Discussion (Misc queries) 1 June 4th 06 03:53 AM
Can I use named range in data range box when creating pie chart? BJackson Charts and Charting in Excel 2 August 17th 05 05:37 PM
Q: Best way to take data from VBA into graphs without writing data to worksheets? (Can a named range refer to an array in memory only?) KR Excel Programming 2 December 16th 04 11:12 PM


All times are GMT +1. The time now is 03:55 PM.

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"