|
-
Mar 4th, 2002, 05:29 AM
#1
Thread Starter
Member
Excel In Vb
I have an excel spread sheet (which only has data in column 1) and would like to copy it another using common dialog boxes.
Please help!
-
Mar 4th, 2002, 05:48 AM
#2
Bouncy Member
TIP: to find out the code for it...
record what you want to do in a macro in excel, then look at the code produced...
-
Mar 4th, 2002, 06:24 AM
#3
Thread Starter
Member
Tried that, there must be a simple way to copy everything in column one and paste it in an other application where there is a free space.
-
Mar 4th, 2002, 06:48 AM
#4
Addicted Member
Try this....it will test your column.....it is slow as it will test all cells for a value
Sub Macro1()
Dim rngRange As Range
Dim bEmpty As Boolean
Dim iCounter As Integer
Set rngRange = Selection
bEmpty = True
For iCounter = Asc("A") To Asc("Z")
Sheets("Sheet1").Columns(Chr(iCounter) & ":" & Chr(iCounter)).Select
While bEmpty
For Each rngRange In Selection
Application.StatusBar = rngRange.Address
DoEvents
If rngRange <> "" Then
bEmpty = False
MsgBox " FOUND VALUE"
Exit For
Else
'Do nothing
End If
Next
Wend
If bEmpty Then
Exit For
Else
bEmpty = True
End If
Next
MsgBox "column" & Selection.Column & " is empty"
End Sub
Another possibility:
Selection.SpecialCells(xlCellTypeLastCell).Select
This selects the last used cell....meaning the next row (to be retrieved with the selection object) will be empty
We have the technology and we are not afraid to use it
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|