Hello guys and girls,
would someone be able to help me with some VBA code please?
I'm new to VBA programming but do have a fair knowledge of Delphi.
What I am after is to click on cell A1 with value "November 2012" to look to see if there is a sheet with the name of that value, if there is to goto that sheet. If the sheet doesn't exist to copy a sheet named template and give it the value of A1. Then change a cell on the new sheet to one from the first sheet.
Example of code;
Cell A1 OnClick
//Check to see if the sheet already exists with the value of A1
DO Check workbook.sheets.name = Sheet1.A1.value;
//If the sheet exists then go to it
IF Check = TRUE THEN Go to workbook.sheet(A1)
//If the sheet does not exist make from the template and rename it the value of A1
ELSE DO
Workbook.Sheet.Create FROM Workbook.sheet(Template);
Workbook.sheet2(newsheet).name := Sheet1.A1.value;
//change the value of cell A2 in the new sheet to be that if A1 in Sheet1
Workbook.Sheet2(newsheet).A2.value := Sheet1.A1.value;
END;
END;
END.
thank you.![]()
Bookmarks