LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,101
Default Access to Excel check box conversion

Try this
Sub changeValues()
Const COLUMNK As String = "K"
Const COLUMNL As String = "L"
Const COLUMNM As String = "M"
Const COLUMNN As String = "N"
Dim iStartingRow As Long
Dim iLastRow As Long

iLastRow = Range(COLUMNK & Rows.Count).End(xlUp).Row
For iStartingRow = 2 To iLastRow
Select Case Range(COLUMNK & iStartingRow).Value
Case Is = -1
Range(COLUMNK & iStartingRow).Value = "TRUE"
Case Is = 0
Range(COLUMNK & iStartingRow).Value = "FALSE"
End Select
Select Case Range(COLUMNL & iStartingRow).Value
Case Is = -1
Range(COLUMNL & iStartingRow).Value = "TRUE"
Case Is = 0
Range(COLUMNL & iStartingRow).Value = "FALSE"
End Select
Select Case Range(COLUMNM & iStartingRow).Value
Case Is = -1
Range(COLUMNM & iStartingRow).Value = "TRUE"
Case Is = 0
Range(COLUMNM & iStartingRow).Value = "FALSE"
End Select
Select Case Range(COLUMNN & iStartingRow).Value
Case Is = -1
Range(COLUMNN & iStartingRow).Value = "TRUE"
Case Is = 0
Range(COLUMNN & iStartingRow).Value = "FALSE"
End Select
Next
End Sub

"GD" wrote:

Columns K-N, from row 2 to the bottom of the sheet (the size of the
spreadsheet will vary, depending on circumstances). Thanks!
--
GD


"Mike" wrote:

What column has the -1 and 0 and what row does your data start with??

"GD" wrote:

Not working. This code goes in the Excel workbook, right? Do I need to
change anything to customize it to my needs?

--
GD


"Mike" wrote:

Try this
Sub changeValues()
Const WHATCOLUMN As String = "A"
Dim iStartingRow As Long
Dim iLastRow As Long

iLastRow = Range(WHATCOLUMN & Rows.Count).End(xlUp).Row
For iStartingRow = 1 To iLastRow
Select Case Range(WHATCOLUMN & iStartingRow).Value
Case Is = -1
Range(WHATCOLUMN & iStartingRow).Value = "TRUE"
Case Is = 0
Range(WHATCOLUMN & iStartingRow).Value = "FALSE"
End Select
Next
End Sub

"GD" wrote:

Not sure if this is an Excel or Access question, but here goes:

Previously, when I performed a copy and paste from an Access query result to
an Excel spreadsheet, the check box values would convert from -1 to Yes, and
0 to No. For some reason, they no longer convert to anything, and are
transferred as -1 and 0.

Can anyone tell me how this happened, and how I can get back to getting the
values to convert to Yes and No??

Thanks!!
--
GD

 
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
2007 Pivot Tbl to Access Conversion Issues LindaSD Excel Discussion (Misc queries) 5 February 7th 18 03:19 PM
Macro to check data from excel list against access query and return value back to excel dreamkeeper Excel Worksheet Functions 0 October 31st 07 07:26 PM
Add tab access to check boxes in a protected Excel sheet form. Suebriquet Excel Discussion (Misc queries) 0 July 25th 07 07:12 PM
Excel to Access *.MDB conversion [email protected] Excel Discussion (Misc queries) 1 January 27th 06 12:24 PM
Activate check "Trust access to Visual Basic " in Excel Pablo via OfficeKB.com New Users to Excel 1 June 23rd 05 04:30 PM


All times are GMT +1. The time now is 12:27 PM.

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

About Us

"It's about Microsoft Excel"