Thread: Visual Basic
View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.misc
Jim Rech Jim Rech is offline
external usenet poster
 
Posts: 2,718
Default Visual Basic

The code you posted is doing very little but it looks like you didn't post
all of it. It's quite readable though. It unprotects all the sheets, makes
2 sheets visible, activates sheet "Data", unhides columns A and B, reads the
value of a cell named "region" into a variable of the same name, selects
cell C3, captures the count of continuous cells from entries from C3 down
into the variable "cellcount", and sets some variables to 0. So, it hasn't
actually produced anything at this point.

--
Jim
"Co-op 20" <Co-op wrote in message
...
|I know almost nothing about visual basic, and my supervisor asked me to add
| some things into the code of a spreadsheet. I know what the code is
supposed
| to do, but I honestly don't know if I'm doing it right. Can someone tell
me
| what exactly this is doing??
|
| Sub data()
| Application.ScreenUpdating = False
| For Each sht In ActiveWorkbook.Sheets
| sht.Activate
| ActiveSheet.unprotect
| Next
| Worksheets("Sheet").Visible = True
| Worksheets("Data").Visible = True
| Worksheets("Data").Activate
| Columns("A:B").Hidden = False
| region = Worksheets("Sheet").Range("Region").Value
| Cells(3, 3).Select
| cellcount = Range(Selection, Selection.End(xlDown)).Count
| umis = 0
| umiu = 0
| umip = 0
| mcpls = 0
| mcplu = 0
| mcplp = 0
| gvfpls = 0
| gvfplu = 0
| gvfplp = 0
| mshs = 0
| mshu = 0
| mshp = 0
| bdchs = 0
| bdchu = 0
| bdchp = 0
|
| These letter groups represent product lines that are being pulled from one
| sheet and grouped together and placed in another sheet. I have to add
another
| group, but can I just add it into the code because how will excel know
what
| it is referencing too?