View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
joel joel is offline
external usenet poster
 
Posts: 9,101
Default Comparing against table to return value

Whe I saw your macro and the enter sheet was called "Half-Yearly" I thought
yo may have multiple sheets that need to be convertered. One for the 1st
half and a one for the 2nd half so I made the code flexible. Try these
changes to put the data into the same sheet. Because of all the formating in
the sheets I think it is better to delete the "Moderated" sheet and recreate
it rahter than to remove all the formating.

From:

Set Sourcesht = Sheets("Half-Yearly - ENTER MARKS")
Set LookupSht = Sheets("Moderation Comaprison")

'copy enter marks to new worksheet
Sourcesht.Copy after:=Sheets(Sheets.Count)
Set ModifiedSht = ActiveSheet
SourceShtName = Sourcesht.Name
ModifiedSht.Name = Replace(SourceShtName, "ENTER", "Moderated")


To:
Set Sourcesht = Sheets("Half-Yearly - ENTER MARKS")
Set LookupSht = Sheets("Moderation Comaprison")
Set ModifiedSht = Sheets("Half-Yearly - Moderated MARKS")

ModifiedSht.delete
'copy enter marks to new worksheet
Sourcesht.Copy after:=Sheets(Sheets.Count)
Set ModifiedSht = ActiveSheet
ModifiedSht.Name = "Half-Yearly - Moderated MARKS"


"iMAN2" wrote:


Thanks, works quite well.

Just one problem, if data is changed in the 'enter marks' sheet and
then re-exported the macro copies the 'enter marks' sheet without
moderating it and makes it into a new sheet call ' enter marks (2)'.

Is it possible so as when a re-export occurs, the data is updated in
the moderated marks sheet.

Thankyou


--
iMAN2
------------------------------------------------------------------------
iMAN2's Profile: http://www.thecodecage.com/forumz/member.php?userid=371
View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=102545