PNG32 PNG32 PNG32 PNG32
PNG32
Forum Excel, VBA, VSTO, Exceltips, Excelhj�lp PNG32 drivs av Excelspecialisten    Logga in     English
PNG32
PNG32 PNG32
PNG32

Logga in

PNG32

Du är inte inloggad. Logga in eller registrera dig för att skriva inlägg eller svara på inlägg.

För frågor om forumet, kontakta oss på webmaster@excelforum.se

PNG32 PNG32
PNG32 PNG32
PNG32

Excelforum

PNG32

 
ForumForumDiskussionerDiskussionerExcelExcelMakro mellan dokumentMakro mellan dokument
Föregående Föregående
 
Nästa Nästa
Nytt inlägg
 2015-10-09 07:04
 
Hej!
Har en fråga om huruvida det går att använda makron som refererar och automatiskt redigerar två olika dokument.

Skrev en beskrivning på engelska, se om ni har någon bra idé!

The first one, introducing (should start when opening document), is supposed to look in doc 1, search for the next number in order (lets say its the 3rd document I create, therefor the next number should be 3) and then input number 3 in a specifik area (H2).

Then, manually, the document is filled in and finished.

The last, finishing macro, should now copy 4 different specifik data in the document that is filled in.
F9:I9 --> B (and the next empty number)
B15:C15 --> C (and the next empty number)
I5 --> D (and the next empty number)
I53 --> E (and the next empty number)

After this is filled in, this second document should be saved in a specifik place.

Than back to the first manuelly filled document, should be renamed after the input number (in this case 3) and saved on a specifik place.

Is this possible?

greetings,
Rasmus
Nytt inlägg
 2015-11-05 13:28
 
Yes, it is possible.

In the code we make references to sheets. We might aswell make references to workbooks. If we have two workbooks we make two variables. Say workbook1 and workbook2.

Workbook1 shall point at the first workbook used, We do it like this
Set workbook1 = ThisWorkbook

The other workbook is more difficult to reference. We do it by letting the first workbook open the other one. When a new workbook is opened it becomes avtive, so directly after opening it we write:

SET workbook2 = ActiveWorkbook.

Then we can reference a cell using workbook2.sheets(1).range("A1")

In other words we put the workbook name before the sheet name.

Best


Kihlman

Excelforum drivs av Excelspecialisten som bedriver utveckling av program, utbildning samt support och hjälp i Excel och VBA.

www.excelspecialisten.se

Föregående Föregående
 
Nästa Nästa
ForumForumDiskussionerDiskussionerExcelExcelMakro mellan dokumentMakro mellan dokument

PNG32 PNG32
Excelforum drivs av Excelspecialisten som bedriver utbildning i Excel och VBA, tillhandahåller support och hjälp med Excel, utvecklar program i Excel. Är ni i behov av en konsult inom Excel, VBA eller VSTO, eller söker en excelkurs, kontakta oss.
Copyright 2013 ExcelSpecialisten XLS AB   Användarvillkor  Personliga uppgifter