Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 10-25-2015, 11:04 PM
MOHAMMEDSALMAN MOHAMMEDSALMAN is offline copy checkbox string and paste it in excel sheet Windows 7 64bit copy checkbox string and paste it in excel sheet Office 2007
Novice
copy checkbox string and paste it in excel sheet
 
Join Date: Sep 2015
Location: Mumbai
Posts: 9
MOHAMMEDSALMAN is on a distinguished road
Default copy checkbox string and paste it in excel sheet

Hi Everyone,

I have checkboxes on vba form and a Sheet as "Sheet3". What I want is, when the user checks any of the checkbox on form I want to copy that string and paste it in column A of Sheet3 and column B should be marked as "X"
I am using the below code but it fails

Code:
For Each ctl In frmEqpDetails.MultiPage1.Pages(0).Controls
    If ctl.Value = True Then
    Sheets("Testing_Sheet").Find(test_info(eqp_count - 1).vis_tests(looper), LookIn:=xlValues) = "X"
    End If
    looper = looper + 1
Next



Please advise.
Reply With Quote
  #2  
Old 10-26-2015, 05:42 AM
Debaser's Avatar
Debaser Debaser is offline copy checkbox string and paste it in excel sheet Windows 7 64bit copy checkbox string and paste it in excel sheet Office 2010 32bit
Competent Performer
 
Join Date: Oct 2015
Posts: 196
Debaser will become famous soon enough
Default

You have not provided enough information - how does this code fail?
Reply With Quote
  #3  
Old 10-26-2015, 09:58 AM
NoSparks NoSparks is offline copy checkbox string and paste it in excel sheet Windows 7 64bit copy checkbox string and paste it in excel sheet Office 2010 64bit
Excel Hobbyist
 
Join Date: Nov 2013
Location: British Columbia, Canada
Posts: 821
NoSparks is a jewel in the roughNoSparks is a jewel in the roughNoSparks is a jewel in the roughNoSparks is a jewel in the rough
Default

Check boxes are boolean not string type.
Can you elaborate?
Reply With Quote
  #4  
Old 10-26-2015, 11:53 PM
MOHAMMEDSALMAN MOHAMMEDSALMAN is offline copy checkbox string and paste it in excel sheet Windows 7 64bit copy checkbox string and paste it in excel sheet Office 2007
Novice
copy checkbox string and paste it in excel sheet
 
Join Date: Sep 2015
Location: Mumbai
Posts: 9
MOHAMMEDSALMAN is on a distinguished road
Default

I have a sheet as "Sheet1" which have test_names in column A.

Equipment Finishing (painting, scratches, damage, etc)
Equipment Alignment (doors, removable panels/covers, locks, section-to section, etc)
Equipment / Device Labels/Nameplates and Component Layout
Torque Marking
Component / Device Inspection (damage to parts, missing screws, etc)

and so on ....

I displaced this test in a form of checkboxes in userform.
There is a copy of this same sheet in the same workbook with sheetname "Testing_Sheet".

Now what I want is, when the user checks any of the checkboxes in userform, an "X" should be placed in "Testing_Sheet" in column B.

Please find the attachment for better understanding and please advice me.
Attached Files
File Type: xlsm Testing hour tool.xlsm (207.9 KB, 11 views)
Reply With Quote
  #5  
Old 10-27-2015, 07:43 AM
NoSparks NoSparks is offline copy checkbox string and paste it in excel sheet Windows 7 64bit copy checkbox string and paste it in excel sheet Office 2010 64bit
Excel Hobbyist
 
Join Date: Nov 2013
Location: British Columbia, Canada
Posts: 821
NoSparks is a jewel in the roughNoSparks is a jewel in the roughNoSparks is a jewel in the roughNoSparks is a jewel in the rough
Default

Try this using F8 to step through the code and see where you would be putting the "X"
Code:
Sheets("Testing_Sheet").Cells.Find(test_info(eqp_count - 1).vis_tests(looper), LookIn:=xlValues).Select
think you'll need to be including an Offset to position the "X"
Reply With Quote
  #6  
Old 10-27-2015, 10:53 PM
MOHAMMEDSALMAN MOHAMMEDSALMAN is offline copy checkbox string and paste it in excel sheet Windows 7 64bit copy checkbox string and paste it in excel sheet Office 2007
Novice
copy checkbox string and paste it in excel sheet
 
Join Date: Sep 2015
Location: Mumbai
Posts: 9
MOHAMMEDSALMAN is on a distinguished road
Default

Hi,


Thanks a lot. Its working. The only minor problem is that I want to put "X" in column B but its getting placed in column A.

How can I define column B in the following code. The following code worked properly.

Code:
Sheets("Testing_Sheet").Cells.Find(test_info(eqp_count - 1).vis_tests(looper), LookIn:=xlValues) = "X"
Thanks
Reply With Quote
  #7  
Old 10-28-2015, 07:41 AM
NoSparks NoSparks is offline copy checkbox string and paste it in excel sheet Windows 7 64bit copy checkbox string and paste it in excel sheet Office 2010 64bit
Excel Hobbyist
 
Join Date: Nov 2013
Location: British Columbia, Canada
Posts: 821
NoSparks is a jewel in the roughNoSparks is a jewel in the roughNoSparks is a jewel in the roughNoSparks is a jewel in the rough
Default

from my previous post
you'll need to be including an Offset to position the "X"

Obviously you prefer fish to fishing.
Reply With Quote
  #8  
Old 10-29-2015, 03:50 AM
MOHAMMEDSALMAN MOHAMMEDSALMAN is offline copy checkbox string and paste it in excel sheet Windows 7 64bit copy checkbox string and paste it in excel sheet Office 2007
Novice
copy checkbox string and paste it in excel sheet
 
Join Date: Sep 2015
Location: Mumbai
Posts: 9
MOHAMMEDSALMAN is on a distinguished road
Default

Thanks,

It worked.

Code:
Sheets("Testing_Sheet").Cells.Find(test_info(eqp_count - 1).vis_tests(looper), LookIn:=xlValues).Offset(, 1) = "X"
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel copy two numbers between specific column and paste in next sheet visha_1984 Excel 1 12-26-2014 07:59 PM
Want to change Macro to copy and paste data to new sheet Vortex69 Excel Programming 0 12-23-2014 09:53 PM
copy checkbox string and paste it in excel sheet Find Results in excel copy the rows to another sheet khalidfazeli Excel 2 02-06-2013 09:38 AM
How to Copy data from Outlook mail and Paste it in a Excel sheet? padhu1989 Outlook 0 09-11-2012 04:07 AM
Word - Calculate and paste values from Excel sheet Augf87 Word 1 07-06-2009 10:26 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 10:35 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2022, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2022 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft