Selecting Workbooks ...

Sep 9, 2007

I'm not sure why but Excel doesn't seem to like the following.

Workbooks("Bulk Forecast.xls").Worksheets("Bulk Forecast").Range("A1:C2").Copy

View 9 Replies


ADVERTISEMENT

Selecting A Range When Switching Between Workbooks

Feb 1, 2007

I select workbook 1, cell A4, then I select workbook 2, cell A4, but when I'm in workbook 2, it does not select cell A4. Am I doing something wrong here? See my code below.

Sub CopyData()
Dim i As Variant

Workbooks("1_2007 Forecast (Ancillary).xls").Worksheets(1).Activate
Cells.Range("a4").Activate

Workbooks("1_2007 Forecast (LGBU).xls").Worksheets(1).Activate

Cells.Range("a4").Activate
End Sub

View 4 Replies View Related

Selecting All Data In Specific Columns Without Selecting Adjacent Column

Mar 10, 2014

Using VBA, I need to Select A1:C14.

The problem is that A1:C14 contains blank cells, and there is also an adjacent column D that I do not want to copy.

So, UsedRegion and CurrentRegion aren't doing it for me. (It selects Column D too.)

Obviously, this is an example...the real data set is an export and varies in size.

View 1 Replies View Related

Copy Worksheets From A Couple Of Workbooks To Other Workbooks

Jun 26, 2014

I have 25 files with certain worksheets that I need to move to 25 other files.

Worksheet 1, 2, 3 and 4 in Workbook A needs to be moved to Workbook A-2014 Worksheet 1, 2, 3 and 4 in Workbook B needs to be moved to Workbook B-2014 Worksheet 1, 2, 3 and 4 in Workbook C needs to be moved to Workbook C-2014 etc....

Is there a way to do this with a macro? Preferably I would like to do this automaticly - i.e. runing the macro from a master file that

1. Opens Workbook A copies the worksheets
2. Open Workbook A-2014 paste the sheets
3. Save and close Workbook A-2014
4. Close workbook A without saving

then doing the same for Workbook B, etc.

View 5 Replies View Related

Close Workbooks And Move In And Out Of Workbooks In VBA

Dec 27, 2009

Basically the main workbook opens 2 files at a time performs a calculate in the main workbook and then copies and pastes information in 3 ranges. Then closes the two open workbooks and loops and performs same operations until it hits the maximum loops. My macro is as follows and I have 3 question in capital letters.

View 3 Replies View Related

Selecting Most Of A Row

Jan 20, 2009

How would i go about selecting a row to the left of any active cell. As far as column B

View 14 Replies View Related

VBA Selecting Top 3

Oct 28, 2009

I'm trying to make a macro that selects the 3 highest values and give these cells a blue backcolor. (The code should skip any blanc cells).

View 10 Replies View Related

Selecting The Right Row

Mar 6, 2007

i did write code to search for the data..and if the data has more than one record then a button will be appear to find all data that related to entered data... and user will have option to press on the select button to select the wanted recored and delete it or update it....the problem is that the select button show the selected data in the form but its not selecting the right data in the sheet. So when i click on delete button it delete the first row which has the same data that entered by the user.

for example, user wants to see all data the belong to the user "Tim", the forms will show all data related to the use Tim... but i want to delete the selected row not the first row with the name of Tim!

i learnt the code from this link [url]

here is the codes for find. find all, and select

Private Sub cmbFind_Click()

Dim strFind, FirstAddress As String 'what to find
Dim rSearch As Range 'range to search
Set rSearch = Sheet1.Range("a2", Range("a65536").End(xlUp))
strFind = Me.txt_num.Value 'what to look for
Dim f As Integer
With rSearch

View 9 Replies View Related

Selecting From A List

Dec 15, 2007

I have a table of adressess and clients with contacts ie

a,b,c,d
client,contact,address,select

in the list there are about 300 entries.

what i want is to put an S in the select column on those clients i am due to visit and then these records to be exported into say a word doc to print off so i have a list of visits i have to do with company contact and addresses

View 10 Replies View Related

Selecting Certain Values For A Sum

Jan 11, 2009

i dont use excel that often, and normally only for really stuff, so apologies, but i couldnt find a solution.

I have a spreadsheet of expenditure, with a column for a category of what was purchased, and then the amounts in the next column, arranged chronologically. eg

01/02/08 food 20.68
06/02/08 petrol 44.65
07/02/08 food 117.65

etc, with various oither columns for week nos (for averages), comments and the like.

Now I would like to do some analysis, for example the mean weekly food spend. I think this should involve checking the category column for "food", and if found, adding the adjacent cell (containing the amount spent) to the sum (and then obviously dividing by number of weeks) - but i cant work out how to do this!

View 3 Replies View Related

Selecting Max Values

Dec 31, 2009

I'm trying to create a formula that searches through a row and selects certain values. I have a list of individuals in rows followed by their 18 scores in columns. What I'm trying to do is only select the best 8 of those scores and add them together. I tried a few things but this is a little over my head.

View 5 Replies View Related

Selecting A Column

Jan 28, 2010

I need to select the whole column ABOVE the active cell. Ctrl-Shift-UpArrow is no good because it stops at the first blank cell. And selecting the whole column is no good either because when I subsequently paste into the column, it pastes in all the empty cells of the column, meaning my worksheets expands from a few hundred rows to 1 million!

Shift-Home does what I want on rows. Is there an equivalent for columns?

View 9 Replies View Related

Selecting From One Set Range To Another

Jul 11, 2014

So in my code I have two set ranges and want to select from one set range to another. The code I have now does not work because I cannot select Range("POBRF:PO"). This is the code.

[CODE]
ARow = Range("A" & Rows.Count).End(xlUp).Row
Set POBRF = Range("A1:A" & ARow)
BRow = Range("I" & Rows.Count).End(xlUp).Row
Set PO = Range("I1:I" & BRow)
Range("POBRF:PO").Select
[CODE/]

View 1 Replies View Related

Selecting Optionbutton Using VBA

Oct 4, 2008

I have two option buttons on each of five spreadsheets in my Excel workbook. Selecting the first option button enables an x to be written to a cell when that cell is clicked with the mouse. Selecting the second option button disables the writing of the x when the cell is clicked with the mouse. I have these working quite well.

My problem is that I want the second option button selected (disable writing of x) when I enter the sheet. I'm pretty certain that I need the code in Sub Worksheet_Activate() but I haven't been able to find the VBA statement to set the second option button on.

Also, unlike having the option buttons on a form, when I select the option button on the spreadsheet in Design mode I can see no property sheet indicating the name, value, etc of the option button.

View 5 Replies View Related

Selecting Ranges Using VBA

Oct 21, 2008

I have a macro that has automated 95% of a task but one thing is still evading me! If I use the keys then this is what I do:

Select cell C192
Select Shift and R-Arrow so that C192 and D192 are selected
Select Ctrl, Shift and Up Arrow so that C1:D192 are selected
Select Shift and Down Arrow so that C2:D192 are selected

View 8 Replies View Related

Selecting All Charts

Nov 26, 2008

I'm trying to find a way to select all charts in a worksheet and pasting them into a new sheet as a jpeg and can't find a way to select the charts all together as a group like if you shift click them.

I'm looking to copy and paste them as a group because they are grouped in a specific way for a report.

View 11 Replies View Related

Name A Textbox Without Selecting It

Dec 10, 2008

i have this code ...

View 11 Replies View Related

Selecting A Worksheet

May 29, 2009

The main worksheet is for buttons to select emergency type and what group should be notified. Subsequent sheets will have different sets of contacts - Col A= Name, Col B = email address, Col C = Yes/No indicator.

The basic code works great as long as the names are on the primary worksheet. When I try to point the code to a different worksheet, the result displayed in the MSGBOX is null. I did this by putting "Worksheets(Sheet2)." in front of "Columns("B")." I double checked the sheet name.

View 2 Replies View Related

Selecting And Inserting A New Row

Jun 17, 2009

I have a question about selecting an entire row, and then inserting a new row. The following code will select, and then insert a new row at row 30:

View 2 Replies View Related

Checkboxes, Selecting

Aug 15, 2009

If I select checkbox1 I want checkbox3 to be false and vice versa, thats simple enough. Everytime I click on one or the other checkboxes I have to reselect the one I want.

It takes two clicks to get a checkbox checked (True).
My listbox will be populated by both lists in the "Checkboxes" code once I select a checkbox, then reselct to repopulate.

Checkboxes:

View 5 Replies View Related

Selecting Columns

Sep 7, 2009

I have a table, that while writing a vba code I need to select the first column in the table (A) and the last column with data inj the table ( unknown which column it is). The last column might change (meaning that it sometimes column B, somestimes column Y etc...depends on the data). I need a way to select only the the first AND the last column in that table(actually it's the last column with data on that sheet). I'm sure there is must be a way I just don't know it!

View 2 Replies View Related

Selecting A1 On Each Sheet?

Mar 28, 2012

I have 5 sheets in a workbook. After a code has run I want each sheet to be in A1 when they click on that tab (as there could be 50,000 rows on each), but when I try recording it it doesn't do it properly (Sometimes the A1 cell is active but the view is somewhere down the bottom of the sheet).

View 2 Replies View Related

Selecting More Than One Column

Oct 4, 2013

Cells(xrow, 3).Select --

Is there any way I can select more than one column.

I tried Cells(xrow, 3:10).Select but it gives error.

View 3 Replies View Related

Selecting Worksheet Name Contains

Jun 9, 2014

I have a macro that my coworker runs weekly to update info. The macro depends on data in a workbook that comes from another source who arbitrarily decides to rename things. I put into my code a 3 situation scenario.

1. If the sheet name = what it is supposed to then activate it
2. Else If the sheet name contains the word "Pivot" then activate it
3. Else load a userform that lists the worsheets in the workbook and allows the user to select the proper sheet.

The code I have is below. It works until I introduce the 3rd option. Is "Else" not the proper syntax here? Because when I run it, it jumps straight to the "Else" statement and loads the userform even if the sheet is named correctly or contains "Pivot" in its name.

Code:
Sub FindPiv()
Dim strWSName As String
Dim s As Worksheet
For Each s In ActiveWorkbook.Sheets

[Code] .......

View 6 Replies View Related

Selecting The Cell To The Right

Aug 3, 2007

how can i select the cell to the right in a macro? i want to runa command in the cell to the right of the one i'm in after a caommand has taken place there

i.e.

1st command run in col b following by selcting the col c and running another command there

View 9 Replies View Related

VBA Selecting Cells Only With A Specified Value

Mar 15, 2008

To make things simple, I have a range of A1:A10. Within this range I only need to select cells thats contain "Tax".

View 9 Replies View Related

Selecting Using End(xlUp)

Apr 29, 2008

I have a line of code used to select an area to be copied and pasted somewhere else

Range("A1:" & Range("AD65536").End(xlUp).Offset(0, 0).Address).Select

however the spreadsheet that supplies the data this selects has been changed and now the last column AD is empty and so this no longer works and selects only the first row of data.

Ideally I need a way of selecting all the rows which have data in, from columns A to AD, based on recognising the last row using column N rather than the last column. I'm not sure this is possible though.

View 9 Replies View Related

Selecting Column By Its

Jul 3, 2008

I wrote a Macro that select info from Worbook "A" to Workbook "B". In that Macro tha columns B:B, E:E and F:F are selected.

The problem is that the layout is not always the same so the correct columns keep shifting positions. The only thing that never changes is the "Column Label" in the first Row.

So, no matter from which column I alway have to copy: "Order Date"; "Status" and "MetofPay".

Is there anyway to tell my macro to look for those columns instead of B:B, E:E and F:F?

View 9 Replies View Related

Selecting Information

Nov 8, 2008

I have a worksheet containing records of data; (by record I mean 1 row of data), i want to move selected records from one worksheet to another, based on criteria. To start with some information to help. my first record starts at cell B6 and ends at cell U6.

the only problem is I don't know how to go about selecting my last row when the last row of data will change

View 9 Replies View Related

Selecting A Printer

Jan 12, 2009

I have a form that all the salespeople use. The last thing in the process is to print the completed form to a specific printer. I recorded a macro to get the proper name of the printer but I am finding out that it records differently for each computer. Is there a way around this?

View 9 Replies View Related







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