Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default textbox value copying

Hi, I have a userform, that is made up of textboxes and checkboxes.
There is also a save button on the sheet. I need help with creating a
macro that is going to paste certain info over to a sales sheet and
keep filling the sheet out as it goes down the sheet.

IE.

First issue
When the save button is clicked, it needs to copy TextBox1.value into
Sheet("Sales Tracking"), Row D, inputing it in the first non-used cell.
Below is the code that I was using, but keep getting an error message
saying that an object is required.

Dim WS As Worksheet
Dim sourceRng As Range, destRng As Range
Set sourceRng = CallType.Value = ""
Set WS = Workbooks("ComTrak").Sheets("Sales Tracking")
Set destRng = WS.Cells(Rows.Count, "D").End(xlUp)(2)
destRng.Formula = sourceRng.Value

Second Issue
When the save button is clicked, I need it to use a similiar code from
above, but use it on the checkboxes. For example, if checkbox1 is
clicked, then it needs to instert a "1" in the first non-used cell in
Row "E", but if it's non-clicked, then it inserts a "0" in the first
non-used cell in Row "E".


Any help will be greatly appreciated!!


---
Message posted from http://www.ExcelForum.com/

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 196
Default textbox value copying

Gidday,
I do not use the fancy code structure used by you
professionals so here is what I would do:
when save button is clicked
sub cmdSave_click()
dim cell
Sheets("Sales Tracking").select
range("D1").select
set d=selection
range(d,d.end(xltoright)).select
for each cell in selection
if cell.value="" then
cell.value=TextBox1.value
exit for
end if
next

Alternatively, you could send the data to me with
instructions and I could create a form for you.
See some of my handiwork at:
http://www.geocities.com/excelmarksway

regards
Mark

-----Original Message-----
Hi, I have a userform, that is made up of textboxes and

checkboxes.
There is also a save button on the sheet. I need help

with creating a
macro that is going to paste certain info over to a sales

sheet and
keep filling the sheet out as it goes down the sheet.

IE.

First issue
When the save button is clicked, it needs to copy

TextBox1.value into
Sheet("Sales Tracking"), Row D, inputing it in the first

non-used cell.
Below is the code that I was using, but keep getting an

error message
saying that an object is required.

Dim WS As Worksheet
Dim sourceRng As Range, destRng As Range
Set sourceRng = CallType.Value = ""
Set WS = Workbooks("ComTrak").Sheets("Sales Tracking")
Set destRng = WS.Cells(Rows.Count, "D").End(xlUp)(2)
destRng.Formula = sourceRng.Value

Second Issue
When the save button is clicked, I need it to use a

similiar code from
above, but use it on the checkboxes. For example, if

checkbox1 is
clicked, then it needs to instert a "1" in the first non-

used cell in
Row "E", but if it's non-clicked, then it inserts a "0"

in the first
non-used cell in Row "E".


Any help will be greatly appreciated!!


---
Message posted from http://www.ExcelForum.com/

.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default textbox value copying

Mark, thanks for your help. Unfortunately that didn't work. I realize
my mistake in my post. I meant Colomn "D", not row, which was causin
it to select cells D1:G1, so i switched it around to work for
coloumn, but it still didn't work. It is only selecting cells D1:D
(cells with text already in them) and not posting what is in th
textbox

--
Message posted from http://www.ExcelForum.com

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
Calculate Textbox value based on another textbox value.doc Tdungate Excel Discussion (Misc queries) 1 February 12th 09 07:11 PM
Calculate Textbox value based on another textbox value Tdungate Excel Discussion (Misc queries) 0 February 12th 09 07:03 PM
Copying Text from TextBox into cells in table and then addign a new row cakonopka[_2_] Excel Programming 1 January 30th 04 04:43 PM
Copying TEXT from Textbox to other location jason Excel Programming 2 September 29th 03 01:29 PM
UserForm TextBox to ActiveSheet TextBox over 256 characters Dan E[_2_] Excel Programming 1 July 28th 03 07:36 PM


All times are GMT +1. The time now is 05:14 AM.

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

About Us

"It's about Microsoft Excel"