Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
How do you write in VBA:-
to select a column then select the range of data held in the column (say B1) then return to Cell a1. The data in the column can change in the workbook as it is updated regulary, so the range of data in the column varies constantly. There are column headings so the range in column B1 must start at B2. Many thanks -- James |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Hi,
It's not entirely clear what you want but maybe this which copies the used range of column B and pastes it into A2 Sub marine() Dim LastRow As Long Set sHt = Sheets("Sheet1")'Change to suit LastRow = sHt.Cells(Cells.Rows.Count, "B").End(xlUp).Row Range("B2:B" & LastRow).Copy _ Destination:=sHt.Range("A2") End Sub -- Mike When competing hypotheses are otherwise equal, adopt the hypothesis that introduces the fewest assumptions while still sufficiently answering the question. "James C" wrote: How do you write in VBA:- to select a column then select the range of data held in the column (say B1) then return to Cell a1. The data in the column can change in the workbook as it is updated regulary, so the range of data in the column varies constantly. There are column headings so the range in column B1 must start at B2. Many thanks -- James |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Try
Range("B2").Select Range(Selection, Selection.End(xlDown)).Select Range("A1").Select Don't know what you want to do with the data you have selected ? "James C" wrote: How do you write in VBA:- to select a column then select the range of data held in the column (say B1) then return to Cell a1. The data in the column can change in the workbook as it is updated regulary, so the range of data in the column varies constantly. There are column headings so the range in column B1 must start at B2. Many thanks -- James |
#4
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Hi James
Do you mean selection of the range A1:Bx where x is variable.....If so try the below Range("A1:B" & Cells(Rows.Count, "B").End(xlUp).Row).Select -- Jacob "James C" wrote: How do you write in VBA:- to select a column then select the range of data held in the column (say B1) then return to Cell a1. The data in the column can change in the workbook as it is updated regulary, so the range of data in the column varies constantly. There are column headings so the range in column B1 must start at B2. Many thanks -- James |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
select max value from row of data and column containing max value | Excel Worksheet Functions | |||
Formula to select every third cell in a very long column of data? | Excel Discussion (Misc queries) | |||
Using formulas to select cells (Ex: Select every nth cell in a col | Excel Discussion (Misc queries) | |||
Select cell, Copy it, Paste it, Return to Previous cell | Excel Discussion (Misc queries) | |||
Select cell containing specific text &return value from another ce | Excel Worksheet Functions |