ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Pasting Variable cell info into a macro (https://www.excelbanter.com/excel-programming/442628-pasting-variable-cell-info-into-macro.html)

ELDANS

Pasting Variable cell info into a macro
 
I'm trying to use a macro to cut and past a date from a cell (which will have
various dates plugged into the cell) back into the macro directly. It works
great the first run as long as the cell information doesn't change. Then of
it doesn't self update the variable information from the cell on subsequent
runs. Being a newbee, how can I write this macro so it picks up the date
information from a specific cell so that when the macro is ran, it uses the
latest info in that cell each time? See below for what I've got so far which
won't update to new info from cell.


Range("B9:F9").Select
Selection.Copy
Sheets("BOM").Select
Selection.AutoFilter Field:=9, Criteria1:="=4/20/2010", Operator:=xlAnd
Selection.AutoFilter Field:=10, Criteria1:="THG"
Selection.AutoFilter Field:=3, Criteria1:="DWG"
Range("D4:D2200").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Routing Sht 1").Select
Range("A14").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
Sheets("BOM").Select
Application.CutCopyMode = False
Range("G4:G2200").Select
Selection.Copy
Sheets("Routing Sht 1").Select
Range("B14").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False

Don Guillett[_2_]

Pasting Variable cell info into a macro
 
If desired, send your file to my address below. I will only look if:
1. You send a copy of this message on an inserted sheet
2. You give me the newsgroup and the subject line
3. You send a clear explanation of what you want
4. You send before/after examples and expected results.


--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"ELDANS" wrote in message
...
I'm trying to use a macro to cut and past a date from a cell (which will
have
various dates plugged into the cell) back into the macro directly. It
works
great the first run as long as the cell information doesn't change. Then
of
it doesn't self update the variable information from the cell on
subsequent
runs. Being a newbee, how can I write this macro so it picks up the date
information from a specific cell so that when the macro is ran, it uses
the
latest info in that cell each time? See below for what I've got so far
which
won't update to new info from cell.


Range("B9:F9").Select
Selection.Copy
Sheets("BOM").Select
Selection.AutoFilter Field:=9, Criteria1:="=4/20/2010", Operator:=xlAnd
Selection.AutoFilter Field:=10, Criteria1:="THG"
Selection.AutoFilter Field:=3, Criteria1:="DWG"
Range("D4:D2200").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Routing Sht 1").Select
Range("A14").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
Sheets("BOM").Select
Application.CutCopyMode = False
Range("G4:G2200").Select
Selection.Copy
Sheets("Routing Sht 1").Select
Range("B14").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False




All times are GMT +1. The time now is 08:17 PM.

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