عدد با قالب متن

 برای نوشتن اعداد باقالب متن می توان از علامت `  قبل از عدد مورد نظر استفاده کرد:

       به طور مثال کد 012 را به صورت    012`  ( کلید پ زیر ESC ~ )  وارد کنید .

یا قبل از نوشتن عدد ،سلول را قابل بندی متن کنید:

FORMAT CELLS>NUMBER>TEXT

 

محافظت از کاربرگ

برای محافظت از کاربرگ در برابر تغییرات نا خواسته باید مراحل زیر را به ترتیب طی کنید:

۱- ابتدا سلول هایی را که می خواهید فرمول های درونشان دیده نشوند یا تغییر نکنند پس از انتخاب سلول مورد نظر، از منوی :

FORMAT>FORMAT CELLS> PROTECTION

 

 

گزینه های LOCKED , HIDEN  راانتخاب می کنیم تا سلول قفل شود اما این قفل تا زمانی که کاربرگ قفل نشود فعال نمی گردد. برای قفل کردن کاربرگ باید آنرا سیو کرده و سپس از منوی

TOOLS>PROTECTION>PROTECT SHEET

را انتخاب نماییم تا کاربرگ با شروط ذکر شده قفل شود آنگاه سلول های قفل شده دیگر تغییر نخواهند کرد.

 

 

سلولهایی که گزینه HIDEN  آنها فعال است، فرمول هایشان را در نوار فرمول نشان نمی دهند ( پس از قفل شدن کاربرگ )

فایل PDF  اکسل مقدماتی

با عرض پوزش از همه دوستان به علت دوری از وبلاگ ؛

 فایل آموزشی اکسل مقدماتی را برای دانلود روی وبلاگ قرار دادم ؛ این فایل ویراستاری نشده و از تمام دوستانی که نظرات، انتقادات و پیشنهادات خود را یادداشت می کنند متشکرم.

دانلود جزوه مقدماتی آموزش اکسل

 

تمرین گزارش گیری با جداول محوری

با استفاده از جدول زیر به سوالات داده شده پاسخ دهید :

 جدول را از اینجا دانلود کنید.

 

در کاربرگ در یافتی:

۱- مجموع دریافتی های علی چقدر است ؟

۲- مجموع دریافتی های هر فرد چقدر است؟

۳- مجموع دریافتی های هر فرد در هر ماه چقدر است؟ ( لیست حقوقی)

۴- میانگین دریافتی های هر فرد از هر بانک چقدر است ؟

در کاربرگ لوازم التحریر :

۱- هر فروشگاه از هر کالا چقدر فروخته ؟

۲- چه کلاهایی در چه شهرهایی بیشتر فروش داشته اند ؟

 

برخی لینکها درست شد

از همه دوستانی که موفق نشدند تمرین ها را دانلود کنند عذر خواهی می کنم . برخی از آنها تغییر کردند و فعلا جواب می دهند .

دانلود تمرین ویژه اکسل پیشرفته

۱-در جدول زیر جمع دریافتی های ALI چقدر است ؟

دانلود تمرین

۲- جمع دریافتی های علی از بانک ملی چقدر است ؟

ترکیب فیلتر ها و تابع  SUBTOTAL 

SUBTOTAL

See Also

Returns a subtotal in a list or database. It is generally easier to create a list with subtotals using the Subtotals command (Data menu). Once the subtotal list is created, you can modify it by editing the SUBTOTAL function.

Syntax

SUBTOTAL(function_num, ref1, ref2, ...)

Function_num    is the number 1 to 11 (includes hidden values) or 101 to 111 (ignores hidden values) that specifies which function to use in calculating subtotals within a list.

Function_num
(includes hidden values)
Function_num
(ignores hidden values)
Function
1 101 AVERAGE
2 102 COUNT
3 103 COUNTA
4 104 MAX
5 105 MIN
6 106 PRODUCT
7 107 STDEV
8 108 STDEVP
9 109 SUM
10 110 VAR
11 111 VARP

Ref1, ref2, are 1 to 29 ranges or references for which you want the subtotal.

Remarks

  • If there are other subtotals within ref1, ref2,… (or nested subtotals), these nested subtotals are ignored to avoid double counting.
  • For the function_num constants from 1 to 11, the SUBTOTAL function includes the values of rows hidden by the Hide command under the Row submenu of the Format menu). Use these constants when you want to subtotal hidden and nonhidden numbers in a list. For the function_Num constants from 101 to 111, the SUBTOTAL function ignores values of rows hidden by the Hide command under the Row submenu of the Format menu). Use these constants when you want to subtotal only nonhidden numbers in a list.
  • The SUBTOTAL function ignores any rows that are not included in the result of a filter, no matter which function_num value you use.
  • The SUBTOTAL function is designed for columns of data, or vertical ranges. It is not designed for rows of data, or horizontal ranges. For example, when you subtotal a horizontal range using a function_num of 101 or greater, such as SUBTOTAL(109,B2:G2), hiding a column does not affect the subtotal. But, hiding a row in a subtotal of a vertical range does affect the subtotal.
  • If any of the references are 3-D references, SUBTOTAL returns the #VALUE! error value.

Example

The example may be easier to understand if you copy it to a blank worksheet.

 
1
2
3
4
5
A
Data
120
10
150
23
Formula Description (Result)
=SUBTOTAL(9,A2:A5) Subtotal of the column above using the SUM function (303)
=SUBTOTAL(1,A2:A5) Subtotal of the column above using the AVERAGE function (75.75)

 

 

 

تمرین IF

تمرین IF : ماکرویی طراحی کنید که نمره ی دانش آموزی را از کاربر گرفته اگر

0=<نمره =<7     ضعیف

7<نمره =<14   متوسط

14<نمره =<20 خوب

پیام های مقابل آنها را چاپ نماید .

Sub NOMREH()

Dim NOM As Single

NOM = InputBox(" نمره را وارد کنید")

If NOM >= 0 And NOM <= 7 Then MsgBox "BAD"

If NOM > 7 And NOM <= 14 Then MsgBox " NOT BAD"

If NOM > 14 And NOM <= 20 Then MsgBox "GOOD"

End Sub

به این نکته توجه داشته باشید که اگر فرامین IF  فقط یک دستور باشند دیگر نیازی به END IF  نیست البته دستور مورد نظر را باید در پشت سر THEN  نوشت .

راهنمای استفاده از دستور شرطی IF

If...Then...Else Statement

       *برگرفته از راهنمای اکسل*

Conditionally executes a group of statements, depending on the value of an expression.

Syntax

If condition Then [statements] [Else elsestatements]

Or, you can use the block form syntax:

If condition Then
[statements]

[ElseIf condition-n Then
[elseifstatements] ...

[Else
[elsestatements]]

End If

The If...Then...Else statement syntax has these parts:

 

Part Description
condition Required. One or more of the following two types of expressions:
  A numeric expression or string expression that evaluates to True or False. If condition is Null, condition is treated as False.
  An expression of the form TypeOf objectname Is objecttype. The objectname is any object reference and objecttype is any valid object type. The expression is True if objectname is of the object type specified by objecttype; otherwise it is False.
statements Optional in block form; required in single-line form that has no Else clause. One or more statements separated by colons; executed if condition is True.
condition-n Optional. Same as condition.
elseifstatements Optional. One or more statements executed if associated condition-n is True.
elsestatements Optional. One or more statements executed if no previous condition or condition-n expression is True.


 

Remarks

You can use the single-line form (first syntax) for short, simple tests. However, the block form (second syntax) provides more structure and flexibility than the single-line form and is usually easier to read, maintain, and debug.

Note   With the single-line form, it is possible to have multiple statements executed as the result of an If...Then decision. All statements must be on the same line and separated by colons, as in the following statement:

If A > 10 Then A = A + 1 : B = B + A : C = C + B

A block form If statement must be the first statement on a line. The Else, ElseIf, and End If parts of the statement can have only a line number or line label preceding them. The block If must end with an End If statement.

To determine whether or not a statement is a block If, examine what follows the Then keyword. If anything other than a comment appears after Then on the same line, the statement is treated as a single-line If statement.

The Else and ElseIf clauses are both optional. You can have as many ElseIf clauses as you want in a block If, but none can appear after an Else clause. Block If statements can be nested; that is, contained within one another.

When executing a block If (second syntax), condition is tested. If condition is True, the statements following Then are executed. If condition is False, each ElseIf condition (if any) is evaluated in turn. When a True condition is found, the statements immediately following the associated Then are executed. If none of the ElseIf conditions are True (or if there are no ElseIf clauses), the statements following Else are executed. After executing the statements following Then or Else, execution continues with the statement following End If.

Tip   Select Case may be more useful when evaluating a single expression that has several possible actions. However, the TypeOf objectname Is objecttype clause can't be used with the Select Case statement.

Note   TypeOf cannot be used with hard data types such as Long, Integer, and so forth other than Object.

شرط ها و ساختار های تصمیم گیری در وی بی ای  IF IN VBA

یکی از مهمترین بخش های هر زبان برنامه نویسی ساختار های تصمیمگیری در آنهاست .

IF  یکی از پرکاربرد ترین دستورات VBA  می باشد ، ساختار آن عبارت است از :

IF    شرط    THEN

عملیات مورد نظر

END IF

مثال : می خواهیم ساختار شرطی ایجاد کنیم که اگر محتویات سلول A1  از عدد 10 کوچکتر بود یک پیام مردودی نمایش دهد . ( فقط ساختار IF   را نمایش می دهیم )

IF  RANGE("A1")<10 THEN

 MSGBOX" مردود"

END IF

تمرین 2

تمرین 2 - ماکرویی طراحی کنید که نام و نام خانوادگی را از کاربر دریافت کرده سپس آنها را در کنار یکدیگر نمایش دهد .

SUB NAM()

DIM N AS STRING

DIM F AS STRING

N= INPUTBOX("ENTER NAME :")

F=INPUTBOX("ENTER FAMILY :")

MSGBOX N&" "&F

END SUB