LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 74
Default Help with looping macro / goto

Hi to all the excel fairies,

I am using a PDF transformer to get data into excel. Unfortunately the
pdf file has tables that the transformer cannot always read properly,
therefore the data I get in excel has strange formatting errors. I was
hoping to sort all of this by code but it is simply impossible. I have
thought of another way of doing this however I am stuck with the
practicalities. (I need this data to be formatted properly before I can
run a giant macro to sort it and chart from it). I would like a
checkdata macro where the user is pointed to each "table" and asked if
the data formatting is correct. This will then make it obvious to the
user if any changes need making, (columns may need moving up or down a
cell, or data entries may need moving across a column etc) and prompt
him to make the necessary changes before continuing.

When the data is transformed it arrives in excel in the form of mini
"tables" (blocks of data normally 9 or 10 columns wide and between 1
and 30 rows down surrounded by a border). There are 26 of these
tables,on one sheet, from rows 1 down to about 900. In between each
"table" there are normally some rows of text. The top left cell of each
"table" is named car 1 to 26.

I would like to take the user to the first "table" and then ask if the
data is formatted correctly. (I have written this code off the top of
my head so apologies for rubbish code that won't work!)

For i = 1 To 26
activesheet.Range("car" & i).Select
ActiveCell.CurrentRegion.Select
msgbox("Is this data formatted correctly?"), vbyesno)

If the data is formatted correctly I want the user to click yes and
then move on to the next "table" etc etc.

That is the simple part. However if the user clicks No - (because there
are problems with the data that need fixing) I need the user to be able
to stop and fix the data. Then I need them to be able to continue
through the loop of checking the rest of the data.

Obviously if they click "No" to the msgbox I could exit the sub with a
msgbox ("Please fix the data") then ask the user to run the checkdata
macro again after making their changes, however this would mean them
re-checking the data they had already checked so is not a great way to
do it.

If anybody understands what I have just written and has any suggestions
I would be most grateful!

Thanks

 
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
GoTo macro... TomCat Excel Discussion (Misc queries) 2 February 19th 09 08:20 AM
goto function in macro 2 mohavv Excel Discussion (Misc queries) 5 January 21st 08 08:33 PM
goto function in macro mohavv Excel Discussion (Misc queries) 1 January 21st 08 01:20 AM
Using 'GoTo' in a Macro adam777 Excel Discussion (Misc queries) 0 June 29th 05 09:16 PM
Edit Macro for GOTO Part No. RSB Excel Programming 2 December 1st 04 07:21 PM


All times are GMT +1. The time now is 08:06 AM.

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"