Select Range Of Contents From Column Which Lies In Between Other Columns

Mar 24, 2013

I have a worksheet in which column A:C contains slno,name etc. Col D contains numerical data.D4:D5 is col heading. D6:D41 contains numerical data. I want to copy the data from D6:D37 only. for this i tried the following but with negative result.

1.select cell D5.
2.press F5 and enter -to goto cell D37.
3. press control and shift and up arrow to select the upper cells. Excel selects from D37 to D4 whereas i want it to be from D37:D6.selecting D6 and then press control shift and enter keys takes me to the last cell with the data in the column, ie,D41.

How can I select only the required cells so that i can copy the content.selecting the first cell and then dragging the cross is not an expected answer to solve this.

View 4 Replies


ADVERTISEMENT

Range Object To Essentially Select An Area Of Cells Whose Contents I Want Cleared

Jun 29, 2006

I'm having a problem in a single line of code in which I'm using a Range Object to essentially select an area of cells whose contents I want cleared.

Here is the
Sheets(Left(c.Value, Len(c.Value) - 1)).Range(Cells(4, 2), " &:& ", Cells(Rows.Count, "b").End(xlUp).Offset(0, 9).Select).ClearContents

I want the range part to evaluate as (b4:whatever the last cell is before the first blank row).

View 9 Replies View Related

Macro To Copy Many Columns Contents And Combing Them In 1 Column

Feb 9, 2009

Was looking into this, but basically i have a repetitive task of copying contents from various columns, and pasting them into 1 column.

1 right after the other. I figured there could be a way for a macro to copy contents from multiple columns and paste them into 1 column.

I have including 2 files, 1 from the start of the file, and 1 how it should be so it will have clarify what i am trying to do.

So basically if you open book1 , i have factory install tabs,

I need the columns contents from the first tab the (5k-20k) starting with Column B, then E, then H, and so on( Every 3rd column starting with B ) to be copied and pasted in Column A of the (Factory Install Tab) ( last tab ).

If you open the 2nd file this will be clearly understood. In the second file in the factory install tab you will notice i did the first 2. I highlighted each starting part in yellow just so its easier to see. SO in column A you should have all the contents in the 5k-20k tab ( starting with b every 3rd ), pasted in column A 1 after the other.

The next tab is the 30k tab, i need all of the columns contents copied starting with B ( every 3rd again ), copied in Column C of the Factory Install tab. Basically every tab's contents needs to have its own column in the Factory Install tab.

If anyone could help that would be great, this is a very time consuming process manually, and it would seem like a macro could be made to easily copy contents.

View 6 Replies View Related

Select Range Of Columns

Jun 26, 2009

I'm in the midst of preparing a Year-To-Date (YTD) simple financial report in MS Excel.

Firstly:
I allow user to enter a number in cell A2.

Secondly:
Cells from A4 - L4 are linked from Sheet1. Cell M4 will give sum of A4:L4. Users are not allowed to change data in cells from A4 - L4. Users are only required to enter a number between 1 to 12 in cell A2. Upon update cell A2, the VBA shall sum the number of columns as entered in cell A2.

For example, if user enter 3 in cell A2 then cell M4 must give sum of A4:C4. If user enter 8 in cell A2 then cell M4 must give sum of A4:H4.

View 9 Replies View Related

True Or False If Number Lies Between A Certain Value

Apr 8, 2014

I have an Excel workbook which has 10 rows of numbers with a min of 20 and max of 30. The random number lies in column B and this will be tested to see if it lies between the min and max. I need to loop this 10 time over

I first started out declaring the 3 variables and assigning values to each variable. It works if I assign a value of 22 for Number but I want VBA to see the Number and make a decision (True or False) if that number lies within the range of 20 to 30.

Should I name the Number variable as a variable because its value will change depending on if it matches the conditions? Also would a case be easier? Between.xlsx

View 4 Replies View Related

Clear Contents Of Column In Range Variable?

Feb 11, 2014

I have a range variable named data I want to clear all the data in the 3rd column in the range variable I know how to reference a single location in the range variable but not a whole column. see example code below

[Code] .....

View 3 Replies View Related

Select A Range That Will Be Changing By Column: Method 'Range' Of Object '_worksheet' Failed

Jan 6, 2010

I'm trying to select a range that will be changing by column. I'm not sure why my syntax isn't working. What I've got:

View 2 Replies View Related

How To Select Range And Skip Over Hidden Columns

May 1, 2014

I have below a code that is selecting from A11 down as far as there is data and across a certain number of columns then sets a print area.

Currently the columns go A, B, JW, JX, JY, JZ, KA, KB as C through to JV are hidden. I have tried to offset the columns by 7 to see if it will select A-KB but it is selecting cells that are hidden and only selecting A-G. I need it to go past the hidden columns. Here is the code:

[Code] ......

Could I also get a code to go from A10 and move over to KB and create a range from there e.g. KB-KJ and last row from there?

View 10 Replies View Related

Dynamic Range To Select Only Visible Columns?

May 6, 2014

I need a macro to start at cell A11 and select across 10 columns and down to the Lastrow (last row with any data).

There are hidden columns after column D so it CANNOT have any columns hardcoded except for column A.

This selection then needs to be set as a single print area to print out on 1 page. I have already set Rows 1-10 as a title area to print at the top of each page.

Code i currently have is:

[Code] .......

I just need it to now go across 10 visible columns and set as a single print area.

View 8 Replies View Related

Select Range Of Columns And Unhide Any That Are Hidden

Dec 10, 2013

I have a macro that allows me to select a range of columns and unhide any that are hidden. I am on the sheet "Employees", but the action happens on the sheet "Enter". I can run this macro when I am on "Employees" and jumps top "Enter" and works exactly as I want it to.

Code:
Sheets("Enter").Select
Columns("B:T").Select
Selection.EntireColumn.Hidden = False
Range("M8") = Sheets("Employees").Range("B5")
Range("I7").Select

But when I try to run it as part of another macro that begins on "Employees", I get "Run-time error '1004': Select method of Range class failed", and Columns("B:T") is highlighted.

View 4 Replies View Related

Excel Function To Select Two Columns Based On Range?

Jul 30, 2014

Function to select two columns based on the header and the variable given.

Sample excel file attached for your ref.

Excel sample.JPG

Find the excel file in which I am looking for an formula which will look up variable in Col A for Eg USD and search the same in Row 1 and then will select COL D:E and so forth for other currency.

View 4 Replies View Related

Select Range Of Current Column To Last Column In Sheet

Jan 30, 2012

I'm trying to make the below two column selections into a selected range to clear out formulas/values in the range.

Current code segments:

ActiveCell.EntireColumn.Select
Columns(ActiveSheet.UsedRange.Columns(ActiveSheet.UsedRange.Columns.Count).Column).EntireColumn.Select

Is there a way to combine the two code segments into one selected range?

View 6 Replies View Related

Select Range In Entire Column To Fit Range From Another

Mar 26, 2013

i want information on my "Intra-op tab" to automatically populate on my "Tissue" tab. In Column "A" of my intra-op tab i enter case id's, 1 per row, and i would enter a date received under column "D". On my "Tissue" tab, i also enter those case id's under column "A" but i would have multiple rows of the same number. I want that whenever i type a specific case id on my "Tissue" tab, it will automatically fill in the date in column "T", the date that coincides with the case id in column "D" of my "Intra-op Kit" tab.

View 1 Replies View Related

Lookup In Column A - Select Column B Range?

Feb 11, 2013

I have a sheet that begining in A3 and going down need to look for the First Instance of the text String "Loan Documents" and down to the last instance and select the corresponding range in column B.

Example: if the Text String appears in Range(A14:A32) I need the Range(B14:B32) to be my selected range.

View 1 Replies View Related

Select Range Depending On A Column

Mar 4, 2009

If i have row 10-20 in column A filled, what vba code would i need to select a range in column C that selects rows 10-20

If that 10-20 rows in column A chnages to say 10-50 the vba code will select 10-50 in column C

View 10 Replies View Related

VBA - Range Select With Active Column

Jul 24, 2014

I have the following code Range("M402").Select

This very simple code brings me to M402 everytime I click on the button.

However, I would like to stay in the same column that I am at the moment when I click the button, and go to row 402. (i.e. if I am in cell "Z56", I would like to be redirected to "Z402" when I click the button.

View 3 Replies View Related

Select Range Based On Last Row And Last Column Used

Aug 12, 2008

I have defined my last row and column by using:

lr = Sheets("week1").Cells(Rows.Count, "A").End(xlUp).Row
LC = Sheets("week1").Cells(1, Columns.Count).End(xlToLeft).Column

Now how do I select the range starting at A2 through the last used column ( LC ) through the last row ( LR )?

View 9 Replies View Related

Select Every Nth Cell In Column Range

May 21, 2008

What is the best way to select every third cell in column c starting with cell C5

View 3 Replies View Related

Select Arbitary Range Of Data In Column

Mar 4, 2009

I wish to collect an arbitary range of data in a column. Hence I wish to identify were the data begins (for example C10) and where the data ends (for example C22), and then copy it and paste it at another sheet. How to do that with VBA-code?

View 9 Replies View Related

Select A Contiguous Range Of Cells In A Column

May 7, 2009

I'm trying to select a contiguous range of cells in a column and then iterate over that. I keep getting error "91", object variable not set. I have:

View 5 Replies View Related

Macro To Select Range With Column Header?

Mar 12, 2003

How would a code look like to select a range with a column header on top. in the code you provided, it selected the entire W column. How would you select the range given that the W column was called Address?

Sheets("Sheet1").Select
Range("W1").Select
Range(Selection, Selection.End(xlDown)).Name = "Problem_Area"

View 6 Replies View Related

Userform One Combobox Three Data Columns Select Required Column Based On Radio Button

Jun 10, 2013

I have a user form that has one combo box on it that right now references one column of data.

Now I am being asked to have three columns of data and the combo box to show one of the three when a certain criteria is met.

I believe it would be easiest to have an additional combox with a change event when the box is populated with "whatever" in the field

So S:3 to S:5 have A, B, C

And EC:1-EC:59, ED:1-ED:59, EE:1-EE:59 contain the data that should show when S:3, S:4, or S:5 is selected.

If S:3 is selected then the list in EC:1 - EC59 would show and so on.

View 2 Replies View Related

Compare Cell Contents With Given Range Of Contents

Dec 30, 2013

I have attached a workbook stating my problem.

file1.xlsx‎

View 10 Replies View Related

Select Column Or Range Based On Current Time

Nov 18, 2013

setup:

Columns: c)6:00 AM, d)6:15 AM, e)6:30 AM
Rows: 4)tech1 Phone, 5)Tech2 Phone, 6)Tech3 Phone

What I am tying to do is to select the column that matches the time, for instance anything before 6 AM would select Column C, betweeb 6 and 6:14 still selects column C, 6:15 to 6:29 selects column D, Etc

View 2 Replies View Related

How To Select An Entire Range Of Non-Contiguous Cells In A Column

Aug 19, 2009

I recently found this code for selecting a whole column of non continuous cells.

ActiveSheet.Range("a1",ActiveSheet.Range("a65536").End(xlUp)).Select
How can I change the "a1" & "a65536" so it can work and be activecell instead?

View 9 Replies View Related

Range.select Error (SELECT METHOD OR RANGE CLASS FAILED)

Jul 23, 2008

I have this:

Private Sub CommandButton1_Click()
Worksheets("Sheet1").Activate
Range("A1").Select
Selection.End(xlDown).Select
ActiveCell.Offset(rowOffset:=1, columnOffset:=0).Activate
ActiveCell.PasteSpecial
End Sub
it errors to: SELECT METHOD OR RANGE CLASS FAILED

View 9 Replies View Related

Find First Blank Cell In First Column Of Known Range / Select And Delete From That Point

Jun 6, 2014

I have multiple tables like the one in the picture and have to duplicate this code for different known ranges.

View 11 Replies View Related

How Do I Select & Use Contents Of First Non-blank Cell In Row

Nov 9, 2005

I've got 12 columns (headed Jan - Dec), each of which contains a combination
of numerical & blank cells. For each row, I want to select the first
non-blank cell and return the column header that it lies in e.g. Row 1, first
non-blank cell is in the Apr column, so I want the text "Apr" to be returned
to another cell.

View 9 Replies View Related

VBA To Select Rows And Sort Contents

Dec 21, 2008

I'm trying to sort a whole list of data that's been separated into blocks with a row containing the value "a" like:

row 9 a
row 10 455
row 11 8892
row 12 34
row 13 a
row 14 578
row 15 92
row 16 a

etc..

I want to sort each block into ascending order using VBA code and then add in some extra code to do some more analysis.

The data to be sorted is in Column D, and there are also values in Column C and B that need to be sorted with the Column D values (so that they stay in the same rows).

View 9 Replies View Related

Merge Cells: Select A Range Based On Two Variables Which Store The Column Numbers

Jul 19, 2009

I am trying to select a range based on two variables which store the column numbers. what I have is:

View 4 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved