Question about Excel (SS8SATAS5128400R)

2 Answers

Variables in Macros?

I have two worksheets and want to
1) select a cell in sheet 1 (cell may change with each search),
2) copy that value,
3) search for the value in the other sheet (filter)
4) copy the values returned and
5) place those values in a specific region in the first spreadsheet

I can do this manually in a macro, but I don't know how to pass a new cell value each time I run the macro in step 1. The value remains hardcoded to the initial value recorded. Do I have to ask the user to select the cell? But how do I capture in in the macro and use it?

The macro code:
Sub Macro9()
'
' Macro9 Macro
'

'
ActiveWindow.Panes(1).Activate
Range("E3").Select
Selection.Copy
With ActiveWindow
.Width = 933.75
.Height = 573.75
End With
Sheets("Sheet2").Select
ActiveSheet.Range("$A$1:$GH$1670").AutoFilter Field:=2, Criteria1:= _
"=DM Review", Operator:=xlAnd
Columns("B:O").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("2008 Edit Cal Deadlines").Select
ActiveWindow.Panes(3).Activate
Range("A222").Select
ActiveSheet.Paste
End Sub

Thank you for your help!

Posted by on

Ad

2 Answers

  • Level 1:

    An expert who has achieved level 1.

    Mayor:

    An expert whose answer got voted for 2 times.

    Problem Solver:

    An expert who has answered 5 questions.

  • Contributor
  • 5 Answers

Are you still looking for an answer?

Posted on May 20, 2008

Ad

God knows

Posted on Feb 12, 2008

Ad

1 Suggested Answer

6ya6ya
  • 2 Answers

SOURCE: I have freestanding Series 8 dishwasher. Lately during the filling cycle water hammer is occurring. How can this be resolved

Hi there,
Save hours of searching online or wasting money on unnecessary repairs by talking to a 6YA Expert who can help you resolve this issue over the phone in a minute or two.

Best thing about this new service is that you are never placed on hold and get to talk to real repairmen in the US.

Here's a link to this great service

Good luck!

Posted on Jan 02, 2017

Add Your Answer

Uploading: 0%

my-video-file.mp4

Complete. Click "Add" to insert your video. Add

×

Loading...
Loading...

Related Questions:

1 Answer

How do I pull a figure from a spread sheet and add it to another in the same file.....


Are you talking about different worksheets in the same file.
go to the other worksheet then go to the particular cell and press = on keyboard
then use mouse to select the other worksheet from the bottom of the spreadsheet .
Then click on the cell you wish to link and press enter key on keyboard.

https://support.office.com/en-us/article/Insert-or-delete-a-worksheet-19d3d21e-a3b3-4e13-a422-d1f43f1faaf2
https://www.microsoftpressstore.com/articles/article.aspx?p=2447199&seqNum=2
https://www.microsoftpressstore.com/articles/article.aspx?p=2447199&seqNum=2

You can also do this to spreadsheets with different file names by opening both spread sheets in different windows and switching between the windows.

you can also copy just the data by copy whole sheet (click on the square in top left hand and copy and then right click paste special on new worksheet - with values only rather than the original formulas from the spreadsheet

Jan 06, 2017 | The Computers & Internet

1 Answer

Using sumifs formula accross multiple sheets


Here is the syntax: =SUMIF(Sheet2!A1:A3,"> 1", Sheet2!B1:B3)

This says if the cells A1 through A3 in worksheet "Sheet2" are greater than 1 then return the values from worksheet "Sheet2" cells B1 through B3.

Change the worksheet name Sheet2 to your worksheet name and change the cell references to the ones you need.

Apr 17, 2009 | Computers & Internet

2 Answers

I Have list of numbers in coloumn in a sheet & i want its uniqe record in another sheet how it to do?


You can use some add in for Excell, can be found much of them on internet. Or follow this instruction: http://www.cpearson.com/excel/Duplicates.aspx for any brainstorming :)

Mar 11, 2009 | Microsoft Computers & Internet

1 Answer

Macro code for copying a range of cells from one Excell w/sheet t


You did not respond to my claification request. Here is some code that might help, it copies a selection of cells going down until an emty cell is found and across until an emty cell is found. This is form an earlier version of office but should comeclose to woring in 2007.

Sub copyrange()
'
' copyrange Macro
' Macro written by Royal 11/22/2008.
'


'save the return values
wksname = ActiveSheet.Name
returncell = ActiveCell.Address
searchfor = ActiveCell.Value

'go to first worksheet and find entered value (note this is a value serach)
Worksheets(1).Activate
findfor = "A1"
On Error Resume Next

findfor = Cells.Find(What:=searchfor, After:=ActiveCell, LookIn:=xlValues, LookAt:= _
xlWhole, SearchOrder:=xlByColumns, SearchDirection:=xlNext, MatchCase:= _
False).Address
If findfor = "A1" Then
erwks = ActiveSheet.Name
Sheets(wksname).Activate
er = MsgBox("Search item not found on Worksheet" + erwks, , "Search Error")
Exit Sub
Else
findfor.Activate
End If

Cells.FindNext(After:=ActiveCell).Activate

'save this address and start searching for copy area boundaries
begcell = ActiveCell.Address
begcl = ActiveCell.Cells.Column
begri = ActiveCell.Cells.Row
'search amaximum of 1000 rows and 676 columns
endri = begri + 1000
endcl = 26 * 26
maxrow = 0
maxcol = 0

For col = Cells.Column To endcl
If Cells(begri, col) = "" Then
maxcol = col
col = endcl
ri = endri
Else
ri = begri
End If
For ri = ri To (Cells.Row + 1000)
If Cells(ri, col) = "" Then
If ri > maxrow Then
maxrow = ri
End If
ri = endri
End If
Next ri
Next col

maxrow = maxrow - 1
maxcol = maxcol - 1

'copy the selected area
endcell = Cells(maxrow, maxcol).Address
crnge = begcell & ":" & endcell
Range(crnge).Select
Selection.Copy
'go back and paste it in
Sheets(wksname).Activate
Range(returncell).Select
' use this if yo want to paste formulas etc.
'ActiveSheet.Paste
' use this code if you want to paste values instead of formulas etc.
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
Range(returncell).Select

Nov 20, 2008 | Computers & Internet

1 Answer

Using Vlookup to copy data from another worksheet


=if(isblank(vlookup(Sheet1!A1,Sheet2!$A$1:$B$4,2,0)),"",vlookup(Sheet1!A1,Sheet2!$A$1:$B$4,2,0))

Sep 12, 2008 | Microsoft Excel for PC

1 Answer

LINE 100


If Sale Line 100 is an Excel Template then it is simple.

The Templates are just preformatted spreadsheets which are edited just like any other spreadsheet.

If you mean that you are using the Template to create another document but wanting all the fields to be the same as the Invoice then I suggest the following method:

Copy the Template fron Worksheet 1 onto Worksheet 2.

Add and remove any fields that you wnt to add or remove (Prices would be deleted on this copy and the title would be changed from Invoice to Delivery Docket, etc)

Then (on Worksheet 2) in the fields that you want to be the same - click on the cell you want the same Data in and hit the = sign. Then go to Worksheet 1 and Click on the cell that you want the data to be the same. Hit Enter. This will send you back to Worksheet 2 and you will see that any data entered into the cell in Worksheet 1 will now also appear in Worksheet 2.

Repeat this process for all the cells you want copied from worksheet 1.

When you complete the data in Worksheet 1 (the Invoice) all the data selected will automatically appear in the cells selected on Worksheet 2.

Try this on worksheet 2 select cell A1, type =, then open worksheet 1 and select B1. You will be returned to worksheet 2 and the formula in cell A1 will now read =Sheet1!A1. Enter anything into Shhet 1 A1 and you will see that it appears in the appropriate cell on Sheet 2.

When you want to print off the Invoice and the Delivery Docket - you only have to open each Worksheet and hit Print and a copy of each worksheet will be printed giving you an Invoice and a Delivery Docket with the appropriate info on each printout (eg if you exclude prices from the Del. Docket then after completing all the details in the Invoice will create a Del Docket with all the relevant information other than the prices.

Does this answer your question?

Apr 25, 2008 | Computers & Internet

1 Answer

Reference other worksheet in excel


eg if i want to add to numbers
in sheet 1 i have the value 20 in cell B3
in sheet 2 i have the value 10 in cell B4

thus the formula would be:

=sheet1!B3+sheet2!B4

Mar 13, 2008 | Microsoft Excel for PC

1 Answer

Excel formula


Hi, I am not really sure if I get your exct meaning, so would I be correct in saying that you wish to copy all the data and structure from DCT INFO across to DCT. If this is correct so long as the dollar data is formatted in the first worksheet to currency then when it is pasted it will maintain its formating into the next sheet.

One question though...Do you wish to change the data on the DCT INFO sheet and wish it to be automatically changed in the DCT sheet?

If yes then you will have to write the following formula into the DCT cells:- =DCT INFO!A1 (where A1 is the first cell of data in sheet DCT INFO that you wish to duplicate.) You can then use auto fill by selecting the cell you just typed the formula in to and then placing the cursor onto the small black square in the righthand bottom of the cell and clicking the left mouse button and holding and dragging down to whereever your data ends. For example A30. Repeat this with the column B.
Let me know if tis is not entirelt what you require and I will try to help further.
Regards
SeaJade

Jan 09, 2008 | Computers & Internet

1 Answer

Vloop


Are you referring to the VLOOKUP function in Microsoft Excel?

I love vlookup!

Suppose you have 1 worksheet with song numbers and titles in Row 1, Cols A:B:

Song# Title
123 Love Me Tender
234 Blue Suede Shoes
345 Dixie

Another worksheet has song number and performer in Row 1, Cols A:B

Song# Performer
123 Elvis Presley
234 Carl Perkins
456 Cher

Notice there is NO performer for song number 345 in the 2nd worksheet.

Now in the 1st work sheet, cell C2 insert this LOOKUP function: =LOOKUP(A2,Sheet2!A:B)

Copy that cell to row 3 and row 4 in Col C. You should get a Performer for all songs even though there is not a song number 345 in the performer worksheet.

Help me out Mr. VLOOKUP.

Insert this VLOOKUP function in cell C2 of the first worksheet: =VLOOKUP(A2,Sheet2!A:B,2,0)

Copy that cell to row 3 and row 4 Col C. You should get the performer names for the 1st 2 songs, but not for 345 Dixie. The result should be #N/A.

That means VLOOKUP could not find a DIRECT match for song 345 in the second worksheet.

That is why I prefer VLOOKUP over LOOKUP.

I have found this explaination of the VLOOKUP parameters helpful:

1. Needle (A2)
2. Haystack (Sheet2!A:B)
3. RELATIVE Col containing result (2)
4. Need DIRECT MATCH ONLY (0)

Hope this helps.

Jan 07, 2008 | Computers & Internet

1 Answer

Exel 2003


You can refer to cells that are on other worksheets by perpending the name of the worksheet followed by an exclamation point (!) to the cell reference. In the following example, the AVERAGE worksheet function calculates the average value for the range C1:C10 on the worksheet named Marketing in the same workbook.

default.aspx?assetid=za010939481033 Refers to the worksheet named Marketing default.aspx?assetid=za010939491033 Refers to the range of cells between C1 and C10, inclusively
  1. Click the cell in which you want to enter the formula.
  2. In the formula bar (formula bar: A bar at the top of the Excel window that you use to enter or edit values or formulas in cells or charts. Displays the constant value or formula stored in the active cell.) default.aspx?assetid=za060515351033, type = (equal sign).
  3. Click the tab for the worksheet to be referenced.
  4. Select the cell or range of cells to be referenced.

Jan 01, 2008 | Microsoft Office Standard for PC

Not finding what you are looking for?
Computers & Internet Logo

Related Topics:

91 people viewed this question

Ask a Question

Usually answered in minutes!

Top Excel Computers & Internet Experts

Marvin
Marvin

Level 3 Expert

83081 Answers

gary433

Level 2 Expert

237 Answers

Brad Brown

Level 3 Expert

17490 Answers

Are you an Excel Computer and Internet Expert? Answer questions, earn points and help others

Answer questions

Manuals & User Guides

Loading...