G
Guest
OS: MS XP
EXCEL: 2000
I have a Marco, which I use to print a selection from a sheet.
I want to use this macro to make the selection. I use a spinner to select
the date. The spinner puts a number in the cell D4. I need to somehow
convert this number into the selection.
I’m not very familiar with the IF statement or the CASE statement. Do I use
a FUNCTION and if I do how do I pass he variable D4?
Exampl:
Number in cell D4 = 4.
Selection needed = Columns("H:H").Select
My Macro.
Application.ScreenUpdating = False
Sheets("Print").Visible = True
Sheets("KC").Select
Cells.Select
Selection.Copy
Sheets("Print").Select
Cells.Select
ActiveSheet.Paste
Cells.Select
Selection.Font.ColorIndex = 0
Selection.Interior.ColorIndex = xlNone
Range("H14").Select
ActiveCell.FormulaR1C1 = "=NOW()+1"
Columns("H:H").Select
Selection.PrintOut Copies:=1, Collate:=True
Cells.Select
Selection.ClearContents
Range("A4").Select
ActiveWindow.SelectedSheets.Visible = False
Application.ScreenUpdating = False
Range("A62").Select
Please hepp.
Thanks in advance.
EXCEL: 2000
I have a Marco, which I use to print a selection from a sheet.
I want to use this macro to make the selection. I use a spinner to select
the date. The spinner puts a number in the cell D4. I need to somehow
convert this number into the selection.
I’m not very familiar with the IF statement or the CASE statement. Do I use
a FUNCTION and if I do how do I pass he variable D4?
Exampl:
Number in cell D4 = 4.
Selection needed = Columns("H:H").Select
My Macro.
Application.ScreenUpdating = False
Sheets("Print").Visible = True
Sheets("KC").Select
Cells.Select
Selection.Copy
Sheets("Print").Select
Cells.Select
ActiveSheet.Paste
Cells.Select
Selection.Font.ColorIndex = 0
Selection.Interior.ColorIndex = xlNone
Range("H14").Select
ActiveCell.FormulaR1C1 = "=NOW()+1"
Columns("H:H").Select
Selection.PrintOut Copies:=1, Collate:=True
Cells.Select
Selection.ClearContents
Range("A4").Select
ActiveWindow.SelectedSheets.Visible = False
Application.ScreenUpdating = False
Range("A62").Select
Please hepp.
Thanks in advance.