Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi all,
I have the following that copies files from folders:- ---------------------- Sub copysomefiles() On Error GoTo ErrorHandler Dim sMess As String Dim ans sMess = "Have you entered your File Prefix (if required) and Destination Filepath (3 & 4)?" & vbCrLf & vbCrLf & _ "Press Yes to confirm, or No to cancel" ans = MsgBox(sMess, vbYesNo, "Copy Filenames") If ans = vbYes Then Dim fname As Range For Each fname In Range("fileRange") FileCopy Range("source") & fname, Range("destination") & Left(fname, 8) & Range("prefix") & Right(fname, 4) Next Exit Sub ErrorHandler: If ans = vbNo Then Exit Sub End If End Sub ---------------- The range "fileRange" is basically the whole of column A, but there can be any number of cells with data in them, and the rest of the range being blank (i.e A1:A100 with data and A100:A65536 without data). How can I get the next command to stop when its reaches a blank cell (i.e. cell A101)? Thanks, Bhupinder |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell | Excel Discussion (Misc queries) | |||
Stopping looped "Find" command | Excel Discussion (Misc queries) | |||
can alarm be coded into a cell "x" hours before date's reached ? | Excel Worksheet Functions | |||
inserting a conditional "go to" command on a excel "if" function | Excel Worksheet Functions | |||
Changing "returned" values from "0" to "blank" | Excel Worksheet Functions |