Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15
Default Checkbox - Output results to a csv file

Hi,

I have a small spreadsheet with 20 check boxes in Column A (A1-A20).
They are all linked to corresponding cells in Column B which give TRUE
or FALSE depending on if they are checked or unchecked. No problem
there.

I have the corresponding check boxes displaying "Computer 1" in cell
C1 and so on down to C20
i.e. Formula in C1 is =IF(B1,"Computer 1","")

Once the user has checked/unchecked as required then I'd like to be
able to save Column C1:C20 and Column D1:D20 to a csv file called
"UserInput.csv"

Thanks
Ephraim
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 35,218
Default Checkbox - Output results to a csv file

I'd start a new workbook
Then back to the original worksheet
Edit|Copy columns C:D
Edit|Pastespecial|values into A1 of the new worksheet in the new workbook

Save this file as the .csv file

Close the new workbook.

========
Another option that may work for you:

Put a formula like this in E1:
=c1&","&d1
and drag down

Then copy this column and paste into NotePad. Save that as a .CSV file.

Depending what's in those fields, you may want to add double quotes, too.



Ephraim wrote:

Hi,

I have a small spreadsheet with 20 check boxes in Column A (A1-A20).
They are all linked to corresponding cells in Column B which give TRUE
or FALSE depending on if they are checked or unchecked. No problem
there.

I have the corresponding check boxes displaying "Computer 1" in cell
C1 and so on down to C20
i.e. Formula in C1 is =IF(B1,"Computer 1","")

Once the user has checked/unchecked as required then I'd like to be
able to save Column C1:C20 and Column D1:D20 to a csv file called
"UserInput.csv"

Thanks
Ephraim


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15
Default Checkbox - Output results to a csv file

On Mar 30, 4:11*pm, Dave Peterson wrote:
I'd start a new workbook
Then back to the original worksheet
Edit|Copy columns C:D
Edit|Pastespecial|values into A1 of the new worksheet in the new workbook

Save this file as the .csv file

Close the new workbook.

========
Another option that may work for you:

Put a formula like this in E1:
=c1&","&d1
and drag down

Then copy this column and paste into NotePad. *Save that as a .CSV file..

Depending what's in those fields, you may want to add double quotes, too.





Ephraim wrote:

Hi,


I have a small spreadsheet with 20 check boxes in Column A (A1-A20).
They are all linked to corresponding cells in Column B which give TRUE
or FALSE depending on if they are checked or unchecked. No problem
there.


I have the corresponding check boxes displaying "Computer 1" in cell
C1 and so on down to C20
i.e. Formula in C1 is =IF(B1,"Computer 1","")


Once the user has checked/unchecked as required then I'd like to be
able to save Column C1:C20 and Column D1:D20 to a csv file called
"UserInput.csv"


Thanks
Ephraim


--

Dave Peterson- Hide quoted text -

- Show quoted text -


I'm trying to make this as transparent to the user as possible. The
resulting file will be providing input to a powershell 2.0 script.
Leaving it to the user leaves room for error. I would like to
eliminate as much user error as possible by automating as much of this
as possible.

I've googled some lengthy examples of how to do this but was hoping
someone with more knowledge than I would be able to provide a quicker
fix for this than the 80 to 100 lines that I was able to find.

Thanks
  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 35,218
Default Checkbox - Output results to a csv file

I'd drop a button from the Forms toolbar on the worksheet and assign this macro
to the button:

Option Explicit
Sub testme()

Dim wks As Worksheet
Dim NewWks As Worksheet
Dim myPath As String
Dim myFileName As String

Set wks = ActiveSheet

myPath = "C:\"
If Right(myPath, 1) < "\" Then
myPath = myPath & "\"
End If

myFileName = "UserInput.csv"

'the first worksheet in a single sheet workbook:
Set NewWks = Workbooks.Add(1).Worksheets(1)

wks.Range("C:d").Copy

With NewWks
.Range("A1").PasteSpecial Paste:=xlPasteValues
'avoid the prompt if the file already exists
Application.DisplayAlerts = False
.Parent.SaveAs Filename:=myPath & myFileName, FileFormat:=xlCSV
Application.DisplayAlerts = True
.Parent.Close savechanges:=False
End With

End Sub



Ephraim wrote:

On Mar 30, 4:11 pm, Dave Peterson wrote:
I'd start a new workbook
Then back to the original worksheet
Edit|Copy columns C:D
Edit|Pastespecial|values into A1 of the new worksheet in the new workbook

Save this file as the .csv file

Close the new workbook.

========
Another option that may work for you:

Put a formula like this in E1:
=c1&","&d1
and drag down

Then copy this column and paste into NotePad. Save that as a .CSV file.

Depending what's in those fields, you may want to add double quotes, too.





Ephraim wrote:

Hi,


I have a small spreadsheet with 20 check boxes in Column A (A1-A20).
They are all linked to corresponding cells in Column B which give TRUE
or FALSE depending on if they are checked or unchecked. No problem
there.


I have the corresponding check boxes displaying "Computer 1" in cell
C1 and so on down to C20
i.e. Formula in C1 is =IF(B1,"Computer 1","")


Once the user has checked/unchecked as required then I'd like to be
able to save Column C1:C20 and Column D1:D20 to a csv file called
"UserInput.csv"


Thanks
Ephraim


--

Dave Peterson- Hide quoted text -

- Show quoted text -


I'm trying to make this as transparent to the user as possible. The
resulting file will be providing input to a powershell 2.0 script.
Leaving it to the user leaves room for error. I would like to
eliminate as much user error as possible by automating as much of this
as possible.

I've googled some lengthy examples of how to do this but was hoping
someone with more knowledge than I would be able to provide a quicker
fix for this than the 80 to 100 lines that I was able to find.

Thanks


--

Dave Peterson
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15
Default Checkbox - Output results to a csv file

On Mar 30, 8:29*pm, Dave Peterson wrote:
I'd drop a button from the Forms toolbar on the worksheet and assign this macro
to the button:

Option Explicit
Sub testme()

* * Dim wks As Worksheet
* * Dim NewWks As Worksheet
* * Dim myPath As String
* * Dim myFileName As String

* * Set wks = ActiveSheet

* * myPath = "C:\"
* * If Right(myPath, 1) < "\" Then
* * * * myPath = myPath & "\"
* * End If

* * myFileName = "UserInput.csv"

* * 'the first worksheet in a single sheet workbook:
* * Set NewWks = Workbooks.Add(1).Worksheets(1)

* * wks.Range("C:d").Copy

* * With NewWks
* * * * .Range("A1").PasteSpecial Paste:=xlPasteValues
* * * * *'avoid the prompt if the file already exists
* * * * Application.DisplayAlerts = False
* * * * .Parent.SaveAs Filename:=myPath & myFileName, FileFormat:=xlCSV
* * * * Application.DisplayAlerts = True
* * * * .Parent.Close savechanges:=False
* * End With

End Sub



Ephraim wrote:

On Mar 30, 4:11 pm, Dave Peterson wrote:
I'd start a new workbook
Then back to the original worksheet
Edit|Copy columns C:D
Edit|Pastespecial|values into A1 of the new worksheet in the new workbook


Save this file as the .csv file


Close the new workbook.


========
Another option that may work for you:


Put a formula like this in E1:
=c1&","&d1
and drag down


Then copy this column and paste into NotePad. *Save that as a .CSV file.


Depending what's in those fields, you may want to add double quotes, too.


Ephraim wrote:


Hi,


I have a small spreadsheet with 20 check boxes in Column A (A1-A20)..
They are all linked to corresponding cells in Column B which give TRUE
or FALSE depending on if they are checked or unchecked. No problem
there.


I have the corresponding check boxes displaying "Computer 1" in cell
C1 and so on down to C20
i.e. Formula in C1 is =IF(B1,"Computer 1","")


Once the user has checked/unchecked as required then I'd like to be
able to save Column C1:C20 and Column D1:D20 to a csv file called
"UserInput.csv"


Thanks
Ephraim


--


Dave Peterson- Hide quoted text -


- Show quoted text -


I'm trying to make this as transparent to the user as possible. The
resulting file will be providing input to a powershell 2.0 script.
Leaving it to the user leaves room for error. I would like to
eliminate as much user error as possible by automating as much of this
as possible.


I've googled some lengthy examples of how to do this but was hoping
someone with more knowledge than I would be able to provide a quicker
fix for this than the 80 to 100 lines that I was able to find.


Thanks


--

Dave Peterson


Absolutely perfect! Exactly what I was looking for. Thank you very
much.
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
output to the same line in a Text file? Bernard Excel Discussion (Misc queries) 2 November 25th 09 08:12 PM
Lookup 2 columns of data, perform, match, output results John Excel Worksheet Functions 2 September 26th 08 11:30 AM
How can I output VBA function results (array's for example) to spreadsheet [email protected] Excel Worksheet Functions 2 January 11th 07 05:49 PM
Multiple input and output results smoothie Excel Discussion (Misc queries) 0 June 12th 06 05:58 PM
Open a print output sent to file Ted Johnston Excel Discussion (Misc queries) 0 February 24th 06 10:10 AM


All times are GMT +1. The time now is 08:57 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"