A1VBCode Forums

Simple test condition ........


http://www.a1vbcode.com/vbforums/Topic31818.aspx

By castnet - 12/21/2012

New guy here……started writing programs with the HP calculators, Wang computers, then Basic, Cobol,Fortran…stopped all that in the late 70’s. At work now….have a estimating program the produces excel spreadsheets for bid reviews…using VBA (Excel 2003)…I’ve refined the spreadsheet report where its much easier to read and understand.



Here’s the problem…the last task I need is for the macro to paste the column headings where I need them….the macro currently ends with my selection of the headers and copying them, its now ready to paste where ever I need them….



Starting at the location “B7” (that’s where the macro’s at) I want to step down thru the B column and test for either one of these conditions;

1.   if the character string = “Section Total:” … I want to move one row up and 3 columns right (offset -1,3) and paste the headers followed by returning to the next test location which should be Offset (2,-3)

2.   if the character string = “Extended Totals” I want the program to stop…I will have reached the end of the spreadsheet … nothing further needed



That’s it…any other string encountered is to be ignored including (“”) ….this should be very easy and would be in any of the other languages but VBA is massively complicated for this task…thanks
By zack - 1/4/2013

Sure is. Tried your luck on another busier forum?