473,669 Members | 2,471 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Enter data in Excel sheet by textbox through VB coding

1 New Member
Hi dear friends.
Can anyone help me?
I created a VB form in Excel and a textbox and one command button. When I click the command button the text entered in the textbox will store in the empty cell range.
Of course it will show do.
But I like when I entered in the text in the textbox which already entered in the Excel sheet msgbox should show that the text already entered you cannot reenter and it should not enter the text again in sheet.
I hope that you can help me?
Sep 7 '07 #1
2 3741
kadghar
1,295 Recognized Expert Top Contributor
Im not quite sure i understood you, but i think this might be useful:

Expand|Select|Wrap|Line Numbers
  1. sub commandbutton1_click()
  2.  
  3. with worksheets(1).cells(1,1)
  4.     if .value<> "" then
  5.         .value = textbox1.text
  6.     else
  7.         msgbox("You cannot fill that cell twice")
  8.     end if
  9. end with
  10.  
  11. end sub
Hope that helps
Sep 7 '07 #2
QVeen72
1,445 Recognized Expert Top Contributor
Im not quite sure i understood you, but i think this might be useful:

Expand|Select|Wrap|Line Numbers
  1. sub commandbutton1_click()
  2.  
  3. with worksheets(1).cells(1,1)
  4.     if .value<> "" then
  5.         .value = textbox1.text
  6.     else
  7.         msgbox("You cannot fill that cell twice")
  8.     end if
  9. end with
  10.  
  11. end sub
Hope that helps
Hi Kadghar,

If condition should be Reversed:

Expand|Select|Wrap|Line Numbers
  1. sub commandbutton1_click()
  2.  
  3. with worksheets(1).cells(1,1)
  4.     if Trim(.value) =  "" then
  5.         .value = textbox1.text
  6.     else
  7.         msgbox("You cannot fill that cell twice")
  8.     end if
  9. end with
  10. end sub
  11.  
REgards
Veena
Sep 8 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

2
5322
by: Niyazi | last post by:
Hi, I have to retrieve a data from AS400 DB2 and after working with data I have to export into one of existing Excel file. I can connect into specific library in AS400 DB2 using AS400 Client-Access v5.2 program using (in VB.NET) ODBC driver (DSN Name …) . I can retrieve datam work on it using VB.NET and I can send into 'NEW' Excel file. My first problem starts here:
9
4276
by: sifar | last post by:
Hi, I am right now learning PHP & want to know if there is a way to send web form data to an Excel sheet located on a network. My windows xp PC doesnot have a copy of Excel. Also i am not connected to the internet, its a local computer. What i am trying to do is to make a PHP script which will send a simple form data to an excel sheet (or create a new Excel sheet) on another PC on a network.
1
17404
by: Steven Stewart | last post by:
I have a user who has been using Excel for a while to keep statistics and print reports. She finds using it cumbersome because of long formulas and a lot of copying and pasting. I have designed a database for her which is intended to make things a lot easier; however, I don't have a lot of experience with Access and I find that designing the reports in Access is tedious. I want to be able to print the reports (which are simply based on...
3
25045
by: Mads Petersen | last post by:
I'm stuck in this code. Hope you can and will help me. I launch it from excel. I have made the following code work, but not as i whant. I need the ranges to be working with something like xlDown. eg. this only transferes the first record in the area. ..Fields("Uge").Value = ws.Range("A98").Value Sub SelectMaster()
0
2833
by: Jack | last post by:
Windows 2K Pro Access/Excel 2003 Hi there, I have a large number of password protected Excel Workbooks. The files are protected by code that runs when the workbook opens. The code asks the user to key in a password into an input box, the password is compared to a a partciular cell on a hidden (xlVeryHidden) sheet and if it matches the Workbooks opens. I have not used the usual Excel password protection as I need to provide for several...
10
11812
by: Niklas | last post by:
Hi Before I start coding I need to be sure that nobody else has not done it yet and that I can use it. I need an import utility which import data from Excel to a database or some object in .NET. The data in Excel is not in structured columns but can exist everywhere in the workbook. For example if I am supposed to import a person and all his/her cars which exist in a workbook I want to be able to create an import protocol and specify...
3
4523
by: natrajsr | last post by:
Hi, I want to load the data of a excel sheet or in the exact excel sheet format into a Rich TextBox control. I have already worked with loading WORD into a Rich TextBox. It is working fine.; But it is taking long time for our need. So we thoguht, we can find another better solution rather than that. Can anyone help me to find out how to load a excel sheet or in the
1
2141
by: jayafeb83 | last post by:
First I created One excel sheet, 3 rows and 3 columns and I retrieve excel data using ASP, that one I got the Answer I have to know thatretrieve from excel sheet and store the excel data in database using ASP OS:Windows XP Language: ASP
0
1468
by: sivadhanekula | last post by:
Hi all, I have to do a project in excel by usung vb. The coding part is done and I am getting the output in .CSV format. when doing project in the main excel sheet I will be having 3 sheets and for every sheet I have done some coding and in the 3rd sheet I have linked with the other sheets, now after running the program my output is the extracted database to be save in .csv format that is happening quite good where the out is saving in the...
0
8465
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8894
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8803
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
7407
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6210
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4206
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4384
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2792
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1787
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.