473,505 Members | 13,599 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

placing an x from a button into a cell

17 New Member
How do you place an x into a cell by clicking a button?
Jun 14 '07 #1
5 1196
kadghar
1,295 Recognized Expert Top Contributor
It depends, if the command button is in a Form, just put it in the code:

Expand|Select|Wrap|Line Numbers
  1. private sub commandbutton1_click()
  2. dim row as long
  3. dim col as integer
  4.  
  5. row = 1
  6. col = 1
  7. cells(row,col).value = "x"  'this will write an x in cell A1
  8. end sub
If you are adding a button to your excel sheet, just write down a sub in a module, something like:

Expand|Select|Wrap|Line Numbers
  1. sub anything()
  2. dim row as long
  3. dim col as integer
  4.  
  5. row = 1
  6. col = 1
  7. cells(row,col).value = "x"  'this will write an x in cell A1
  8. end sub
hope this helps

Kad
Jun 14 '07 #2
golf32902
17 New Member
Thanks it works great
Jun 14 '07 #3
golf32902
17 New Member
to the same question is there a way to have it take the x out of anouther cell if you have it in anouther cell. for example i have a done and not done colums. II'm lookin to put an x in the not done cell and when it is done then i would like it to put an x in the done and get ride of the not done one. Thanks for all the help.
Jun 19 '07 #4
kadghar
1,295 Recognized Expert Top Contributor
to the same question is there a way to have it take the x out of anouther cell if you have it in anouther cell. for example i have a done and not done colums. II'm lookin to put an x in the not done cell and when it is done then i would like it to put an x in the done and get ride of the not done one. Thanks for all the help.
Sure, just read carefuly the code:

Expand|Select|Wrap|Line Numbers
  1. sub anything()
  2. dim row as long
  3. dim col as integer
  4.  
  5. row = 1
  6. col = 1
  7. cells(row,col).value = "x"  'this will write an x in cell A1
  8. end sub
where it says Row and Col, just change the number, if you want the cell B5 just put

Row = 5
Col = 2

and if you want to clear the cell, instead of filling it with "x", just fill it with ""

;-) Good Luck
Jun 19 '07 #5
golf32902
17 New Member
Thanks it worked great.
Jun 19 '07 #6

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

Similar topics

3
5270
by: Richard | last post by:
Hi I am trying to place an e-mail link into a cell of an Access 2002 table. Have tried setting the cell as both a hyperlink and as plain text and putting the following into the box: <a...
6
2225
by: dhnriverside | last post by:
Hi peeps, I'm trying to create some controls textboxes at runtime, based on the number of items in a IETreeView that are checked. That I can do, I've got a place holder and I can create the...
4
4514
by: Kurt Schroeder | last post by:
I am trying to add a link button to a calendar. this is a simple example: Private Sub Calendar1_DayRender(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DayRenderEventArgs) Handles...
2
1171
by: jagdishl | last post by:
hi: I need to place a submit button immediately after the datalist which may at times be very long.I had posted this problem before and I was asked to change the layout from "Grid" to "Flow"...
6
9943
by: anirban.anirbanju | last post by:
hi there, i've some serious problem to add rows dynamically in a table. my table contains 5 cell. | check | from_value | to_value | color_text | color_value |...
1
16457
by: Bart Lateur | last post by:
I'm trying to put a utton at the bottom (right) of a TD cell, irrespective of what else is in there. Usually, with other HTML block elements, we're told to use position: relative on the...
1
10467
by: CoolFactor | last post by:
MY CODE IS NEAR THE BOTTOM I want to export this Access query into Excel using a command button on an Access form in the following way I describe below. Below you will find the simple query I am...
3
1233
by: foss | last post by:
I have got a Html form with a table. The table contains textfield and a button. When I click the button I want another textfiled to be created. (I have done till here) The problem is that I...
1
1628
by: Forumtroll | last post by:
I have a Web User Control that parses an XML file and renders a Form based on the XML. The problem is that I create a button on the bottom of the form that will fire off a subscribeable event, but...
0
7098
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7298
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,...
1
7017
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5610
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,...
1
5026
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...
0
4698
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3187
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...
0
3176
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
754
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.