| | |
Selecting the first and second characters in an excel cell
Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums - DaniWeb Sister Site
Thread Solved |
•
•
Join Date: Oct 2009
Posts: 20
Reputation:
Solved Threads: 0
Hello,
I am having trouble figuring out the correct syntax for a small portion of my code. I am trying to have my code search through a column and for each entry in that column copy and paste only the rows that have the following characteristics: the first character = 0 and the second character = the value in cell (1, 9) in the current worksheet.
Below is the logic I have come up with (don't worry about "y" or "vend": they have already been declared in previous code):
The only part I need help with is determining the correct syntax for selecting the first and second characters in a cell. The other stuff in quotes I already know.
Thanks in advance for your help,
Jordan
I am having trouble figuring out the correct syntax for a small portion of my code. I am trying to have my code search through a column and for each entry in that column copy and paste only the rows that have the following characteristics: the first character = 0 and the second character = the value in cell (1, 9) in the current worksheet.
Below is the logic I have come up with (don't worry about "y" or "vend": they have already been declared in previous code):
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
For y = 3 To vend + 1 If "the 1st character" = 0 and "the 2nd character" = Range("I1") Then Range("B" & y & ":F" & y).Copy "Find last row in sheet 'Selected Values'" "Paste in that cell" End If Next y
The only part I need help with is determining the correct syntax for selecting the first and second characters in a cell. The other stuff in quotes I already know.
Thanks in advance for your help,
Jordan
![]() |
Similar Threads
- resize image within a excel cell using vb (Visual Basic 4 / 5 / 6)
- [Urgent] Write excel cell values to SQL DB based on cell color? (PHP)
- Need help in converting multiple text files into excel worksheets in a workbook (Shell Scripting)
- Export/Import Excel in java (Java)
- vb 5.0 to excel (Visual Basic 4 / 5 / 6)
- Many problems using ASP and Excel (ASP)
- Saving Excel Spreadsheet using ADO.net gives inconsistent results (C#)
Other Threads in the Visual Basic 4 / 5 / 6 Forum
Views: 438 | Replies: 2
| Thread Tools | Search this Thread |
Tag cloud for Visual Basic 4 / 5 / 6
* 6 429 2007 access activex add age append application basic beginner birth bmp c++ calculator cd cells.find click client code college column connection connectionproblemusingvb6usingoledb copy creat ctrl+f data database datareport date delete dissertations dissertationthesis dissertationtopic edit error excel excelmacro file filename form hardware header iamthwee image inboxinvb internetfiledownload keypress label listbox listview liveperson login looping machine microsoft movingranges number objectinsert open oracle password prime program prompt range-objects readfile reading record refresh remotesqlserverdatabase report retrieve save search sendbyte sites sort sql sql2008 sqlserver struct subroutine table tags textbox time timer urldownloadtofile vb vb6 vb6.0 vba visual visualbasic visualbasic6 web window





