ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Modfiy row of VB to select range of columns (https://www.excelbanter.com/excel-programming/371186-modfiy-row-vbulletin-select-range-columns.html)

Darin Kramer

Modfiy row of VB to select range of columns
 
Hi there,

I currently have VB (extract below) that says

Set sh = bk.Worksheets("James")
Set dest = ThisWorkbook.Worksheets(1).Cells(i, 1)
i = i + 1
sh.Rows(3).Copy

I want to change the last line of text to enable me to select all rows
with text in at least column A, or if thats too dificult then to select
from row 1 to row 300, what is the syntax for the last line of code...

Thanks

D

*** Sent via Developersdex http://www.developersdex.com ***

stevebriz

Modfiy row of VB to select range of columns
 

to do all rows in the range

Sheets("James").Select
Range("A1:A300").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Sheet1").Select
Range("A1").Select
ActiveSheet.Paste


Darin Kramer

Modfiy row of VB to select range of columns
 

Thanks - thats the normal way to select rows, but within this code it
doesnt work as it just enters into a strange loop. I think its not
specific - ie telling excel to advance a certain number of columns, like
I + 299....

Tom you out there.....?


*** Sent via Developersdex http://www.developersdex.com ***


All times are GMT +1. The time now is 03:22 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com