View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Mikeice[_30_] Mikeice[_30_] is offline
external usenet poster
 
Posts: 1
Default Variable cell in vba code


What I am trying to do is based on a cell in the MENU sheet B25
I want the blue hightlight in the cell to become the same.

Eg. IF B
B25 is July then the worksheet name will become July.

Is that possible?

Please help




Private Sub CommandButton7_Click()

Dim wbk As Workbook
Dim wks As Worksheet
Dim SrcBook As Workbook

Set SrcBook = ActiveWorkbook


Set wbk = Workbooks.Open("K:\Data.xls")
Set wks = wbk.Sheets("Sheet1")


Application.ScreenUpdating = False

SrcBook.Sheets("Transfer").UsedRange.Copy Destination:= _
wks.Range("B2")

wbk.Close (False)

Application.ScreenUpdating = True

End Su

--
Mikeic
-----------------------------------------------------------------------
Mikeice's Profile: http://www.excelforum.com/member.php...fo&userid=2246
View this thread: http://www.excelforum.com/showthread.php?threadid=39151