2 réponses
Bonjour,
Je comprends bien qu'excel n'est pas tres facile, néanmoins serait il possible d'avoir un exposé complet du probleme :
De ce que je comprends, tu veux copier la cellule B15 de la feuille Ax1. Mais je ne sais pas où la coller.
Merci d'etre plus precis du premier coup.
jéjé
Je comprends bien qu'excel n'est pas tres facile, néanmoins serait il possible d'avoir un exposé complet du probleme :
De ce que je comprends, tu veux copier la cellule B15 de la feuille Ax1. Mais je ne sais pas où la coller.
Merci d'etre plus precis du premier coup.
jéjé
Ngus 1er.
Tu dis avoir une macro qui récupère diverses données. Où sont stockées les données ? en mémoire dans un tableau ? un fichier .txt ? Peux-tu coller ta macro ici ?
;o)
Tu dis avoir une macro qui récupère diverses données. Où sont stockées les données ? en mémoire dans un tableau ? un fichier .txt ? Peux-tu coller ta macro ici ?
;o)
Les donnée sont de tt types et sont stockées sur un disque dur.
voici la macro:
Option Explicit
Sub ListFilesInFolder(strFolderName As String, bIncludeSubfolders As Boolean)
Static FSO As FileSystemObject
Dim oSourceFolder As Scripting.Folder
Dim oSubFolder As Scripting.Folder
Dim oFile As Scripting.File
Static wksDest As Worksheet
Static iRow As Long
Static bNotFirstTime As Boolean
If Not bNotFirstTime Then
Set wksDest = ActiveSheet
Set FSO = CreateObject("Scripting.FileSystemObject")
wksDest.Cells(1, 1) = "Parent folder"
wksDest.Cells(1, 2) = "Full path"
wksDest.Cells(1, 3) = "File name"
wksDest.Cells(1, 4) = "Size"
wksDest.Cells(1, 5) = "Type"
wksDest.Cells(1, 6) = "Date created"
wksDest.Cells(1, 7) = "Date last modified"
wksDest.Cells(1, 8) = "Date last accessed"
wksDest.Cells(1, 9) = "Attributes"
wksDest.Cells(1, 10) = "Short path"
wksDest.Cells(1, 11) = "Short name"
iRow = 2
bNotFirstTime = True
End If
Set oSourceFolder = FSO.GetFolder(strFolderName)
For Each oFile In oSourceFolder.Files
wksDest.Cells(iRow, 2) = oFile.Path
wksDest.Cells(iRow, 3) = oFile.Name
wksDest.Cells(iRow, 5) = oFile.Type
wksDest.Cells(iRow, 6) = oFile.DateCreated
wksDest.Cells(iRow, 9) = oFile.Attributes
wksDest.Cells(iRow, 10) = oFile.ShortPath
wksDest.Cells(iRow, 11) = oFile.ShortName
iRow = iRow + 1
Next oFile
For Each oSubFolder In oSourceFolder.SubFolders
Next oSubFolder
If bIncludeSubfolders Then
For Each oSubFolder In oSourceFolder.SubFolders
ListFilesInFolder oSubFolder.Path, True
Next oSubFolder
End If
End Sub
Sub teste()
ListFilesInFolder ":G:\Clément", True
End Sub
Voila
voici la macro:
Option Explicit
Sub ListFilesInFolder(strFolderName As String, bIncludeSubfolders As Boolean)
Static FSO As FileSystemObject
Dim oSourceFolder As Scripting.Folder
Dim oSubFolder As Scripting.Folder
Dim oFile As Scripting.File
Static wksDest As Worksheet
Static iRow As Long
Static bNotFirstTime As Boolean
If Not bNotFirstTime Then
Set wksDest = ActiveSheet
Set FSO = CreateObject("Scripting.FileSystemObject")
wksDest.Cells(1, 1) = "Parent folder"
wksDest.Cells(1, 2) = "Full path"
wksDest.Cells(1, 3) = "File name"
wksDest.Cells(1, 4) = "Size"
wksDest.Cells(1, 5) = "Type"
wksDest.Cells(1, 6) = "Date created"
wksDest.Cells(1, 7) = "Date last modified"
wksDest.Cells(1, 8) = "Date last accessed"
wksDest.Cells(1, 9) = "Attributes"
wksDest.Cells(1, 10) = "Short path"
wksDest.Cells(1, 11) = "Short name"
iRow = 2
bNotFirstTime = True
End If
Set oSourceFolder = FSO.GetFolder(strFolderName)
For Each oFile In oSourceFolder.Files
wksDest.Cells(iRow, 2) = oFile.Path
wksDest.Cells(iRow, 3) = oFile.Name
wksDest.Cells(iRow, 5) = oFile.Type
wksDest.Cells(iRow, 6) = oFile.DateCreated
wksDest.Cells(iRow, 9) = oFile.Attributes
wksDest.Cells(iRow, 10) = oFile.ShortPath
wksDest.Cells(iRow, 11) = oFile.ShortName
iRow = iRow + 1
Next oFile
For Each oSubFolder In oSourceFolder.SubFolders
Next oSubFolder
If bIncludeSubfolders Then
For Each oSubFolder In oSourceFolder.SubFolders
ListFilesInFolder oSubFolder.Path, True
Next oSubFolder
End If
End Sub
Sub teste()
ListFilesInFolder ":G:\Clément", True
End Sub
Voila
='Ax1'!B15
mais ce n'est pas du VBA
J'ai fais une macro qui me permet de recupérer le listing complet des fichier d'un dossier(titre, date,...). Je voudrais dire à excel qu'il me le mette (par exemple) dans la ma feuille appellé "Axe1" à partir de la cellulle B15.
Est-ce plus claire?
Clément.
Sub coller()
Worksheets("toto").Range("A1").Value = Worksheets("Ax1").Range("B15").Value
End Sub
Ca c'est du VBA ;)
Oui, exact c'est du VBA ... qui ne répond pas au problème.