Click here to Skip to main content
15,914,222 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: Error 2023 in Range Pin
DaveAuld16-Jul-10 3:56
professionalDaveAuld16-Jul-10 3:56 
GeneralRe: Error 2023 in Range Pin
priyaahh17-Jul-10 7:08
priyaahh17-Jul-10 7:08 
QuestionData binding Pin
waner michaud15-Jul-10 11:19
waner michaud15-Jul-10 11:19 
AnswerRe: Data binding Pin
AnnieMacD15-Jul-10 12:16
AnnieMacD15-Jul-10 12:16 
Questionvb script code Pin
henkbongers15-Jul-10 10:57
henkbongers15-Jul-10 10:57 
AnswerRe: vb script code Pin
DaveAuld15-Jul-10 12:38
professionalDaveAuld15-Jul-10 12:38 
AnswerRe: vb script code Pin
Smithers-Jones16-Jul-10 1:07
Smithers-Jones16-Jul-10 1:07 
QuestionRemove whitespace in front of String element of an Array (vba, excel macro) Pin
TabascoSauce15-Jul-10 6:02
TabascoSauce15-Jul-10 6:02 
I created a macro that gets a list of elements (strings), puts them into an array, then creates an appropriate number of worksheets each named after an element in the array.

Everything works fine. However, occationally when dealing with this list of elements, they are arranged in a sort of list-sublist-evenmoresublist pattern, meaning that there is some variable number of whitespace in front of some of the elements.

I know this is fairly simple, I am not entirely new to the programming world, but I am new to vba in Excel and from prior experiences working with macros, there is a ton of built in functions that I am unaware of and they makes tasks like these pretty simple. (excuse the run-on Big Grin | :-D )

Here is the block that handles my count elements/load into array (feel free to correct it if there is a simpler route):
'Count Elements, dimension element array to appropriate size
    n = 7
    eCount = 0
    Do While Worksheets("Costs Incurred").Cells(n, 2) <> ""
        If Worksheets("Costs Incurred").Cells(n, 2) <> "" Then
            eCount = eCount + 1
        End If
        n = n + 1
    Loop
    ReDim elements(1 To eCount)
    
'Load Element names into Element Array
    n = 1
    Do While n <= eCount
        elements(n) = Worksheets("Costs Incurred").Cells(n + 6, 2)
        n = n + 1
    Loop


Thanks for any help!
AnswerRe: Remove whitespace in front of String element of an Array (vba, excel macro) [modified] Pin
DaveAuld15-Jul-10 6:07
professionalDaveAuld15-Jul-10 6:07 
AnswerRe: Remove whitespace in front of String element of an Array (vba, excel macro) Pin
DaveAuld15-Jul-10 12:25
professionalDaveAuld15-Jul-10 12:25 
GeneralRe: Remove whitespace in front of String element of an Array (vba, excel macro) Pin
Neville Nazerane20-Jul-10 3:00
Neville Nazerane20-Jul-10 3:00 
QuestionHow to Maintain Copy of SortDescriptionCollection After DataGrid Rebind Pin
D.Dubya15-Jul-10 3:36
D.Dubya15-Jul-10 3:36 
QuestionHow to execute SQL Query inside DataSet? Pin
Аslam Iqbal14-Jul-10 10:10
professionalАslam Iqbal14-Jul-10 10:10 
AnswerRe: How to execute SQL Query inside DataSet? Pin
Wayne Gaylard14-Jul-10 20:57
professionalWayne Gaylard14-Jul-10 20:57 
GeneralRe: How to execute SQL Query inside DataSet? Pin
Аslam Iqbal14-Jul-10 21:53
professionalАslam Iqbal14-Jul-10 21:53 
AnswerRe: How to execute SQL Query inside DataSet? [modified] Pin
DaveAuld15-Jul-10 4:04
professionalDaveAuld15-Jul-10 4:04 
QuestionArchive or backup Pin
Ebube14-Jul-10 5:15
Ebube14-Jul-10 5:15 
AnswerRe: Archive or backup Pin
Luc Pattyn14-Jul-10 5:17
sitebuilderLuc Pattyn14-Jul-10 5:17 
GeneralRe: Archive or backup [modified] Pin
Ebube14-Jul-10 6:00
Ebube14-Jul-10 6:00 
GeneralRe: Archive or backup Pin
Luc Pattyn14-Jul-10 6:39
sitebuilderLuc Pattyn14-Jul-10 6:39 
AnswerRe: Archive or backup Pin
DaveAuld15-Jul-10 4:10
professionalDaveAuld15-Jul-10 4:10 
Questionhow to use winsock to exchange data in 2 diferent exe Pin
zhiyuan1613-Jul-10 18:39
zhiyuan1613-Jul-10 18:39 
AnswerRe: how to use winsock to exchange data in 2 diferent exe Pin
Eddy Vluggen14-Jul-10 3:07
professionalEddy Vluggen14-Jul-10 3:07 
AnswerRe: how to use winsock to exchange data in 2 diferent exe Pin
Аslam Iqbal14-Jul-10 9:01
professionalАslam Iqbal14-Jul-10 9:01 
Questioncolumntype checkbox does not chech Pin
Ebube13-Jul-10 5:42
Ebube13-Jul-10 5:42 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.